15 qDebug() <<
"appPort" <<
appPort;
28 QNetworkDatagram data;
32 qDebug() <<
"Receiving CAM";
44 CAM_t *receivedCAM = 0;
47 print_hexa((
unsigned char*)data.data(), data.length());
49 if(rval.code !=
RC_OK)
51 fprintf(stderr,
"Unable to decode CAM: %s\n", rval.code ==
RC_FAIL ?
"RC_FAIL" :
"RC_WMORE");
57 fprintf(stderr,
"CAM received has wrong protocol version: %ld instead of %d\n", receivedCAM->header.protocolVersion,
protocolVersion_currentVersion);
63 fprintf(stderr,
"CAM received has wrong message ID: %ld instead of %d\n", receivedCAM->header.messageID,
messageID_cam);
67 printf(
"CAM decoded :\n");
78 QDataStream ds(&resUt, QIODevice::WriteOnly);
80 ds << (quint16)packet.length();
81 ds.writeRawData(packet.data(), packet.length());
82 qDebug() << packet.length() <<
"bytes sent to" <<
appPort;
83 qDebug() << resUt.toHex();
asn_TYPE_descriptor_t asn_DEF_CAM
QUdpSocket * m_internalSocket
quint16 camDestinationPortInfo() const
camDestinationPortInfo CAM destination port info getter.
asn_dec_rval_t uper_decode_complete(struct asn_codec_ctx_s *opt_codec_ctx, struct asn_TYPE_descriptor_s *type_descriptor, void **struct_ptr, const void *buffer, size_t size)
void print_hexa(const unsigned char *msg, int l, FILE *stream=stdout)
print_hexa Print a byte array.
~caReceptionManagement()
~caReceptionManagement caReceptionManagement destructor.
void addBTPPort(quint16 port, quint16 portInfo, quint16 internal)
addBTPPort Add BTP port to the internal BTP ports.
quint16 internalPort(QString service)
internalPort Get the internal BTP port from service name.
void addPort(QString service, quint16 port)
addPort Add BTP port to the internal BTP ports from service name.
CAM reception management.
caReceptionManagement(ParameterNetwork *network)
quint16 internalBTPPort(quint16 port, quint16 portInfo)
internalBTPPort Get the internal BTP port.
void camEventIndication(QByteArray packet)
camEventIndication Notify the Application of receiving a CAM.
void readDatagram()
readDatagram Slot used when a datagram is received.
quint16 camDestinationPort() const
camDestinationPort CAM destination port getter.
bool decodeCam(QByteArray data)
decodeCam Try to decode received CAM.