Crtp Protocol - connection procedure between client and CF
Posted: Thu May 21, 2015 10:28 am
Hello everyone!
I have translated the whole CRTP communication protocol in Ada and I'm receiving radio packets in the CRTP_PORT_LINK.
The crtpservice module seems to handle a sort of acknowledgement between the Crazyflie and the python client, and the packet channel seems to
determine what response the Crazyflie has to send to the client.
In the original C code, there are 3 possible responses:
And they are serviced like this in the crtp packet handler:
The problem is that when I receive packets for this module, the channel value of the packet is set to 3, which does not correspond with any of the 'LinkNbr' enum value: no response is given to the client in this case.
I noticed that, in the client side, I get these messages when I connect to my Crazyflie:
My question is: What is the "request connection setup" that the client is waiting for? Is that related with the fact that I don't send anything in response when a packet is received in the crtpservice module (due to the fact that the channel value is set to 3, which doesn't make any sense to me)?
I have translated the whole CRTP communication protocol in Ada and I'm receiving radio packets in the CRTP_PORT_LINK.
The crtpservice module seems to handle a sort of acknowledgement between the Crazyflie and the python client, and the packet channel seems to
determine what response the Crazyflie has to send to the client.
In the original C code, there are 3 possible responses:
Code: Select all
typedef enum {
linkEcho = 0x00,
linkSource = 0x01,
linkSink = 0x02,
} LinkNbr;
Code: Select all
void crtpserviceHandler(CRTPPacket *p)
{
switch (p->channel)
{
case linkEcho:
crtpSendPacket(p);
break;
case linkSource:
p->size = CRTP_MAX_DATA_SIZE;
crtpSendPacket(p);
break;
case linkSink:
/* Ignore packet */
break;
default:
break;
}
}
I noticed that, in the client side, I get these messages when I connect to my Crazyflie:
Code: Select all
INFO:cflib.crazyflie:Callback->Connection initialized[radio://0/2/2M]
INFO:cflib.crazyflie:We are connected[radio://0/2/2M], request connection setup
WARNING:cflib.crazyflie:Got link error callback [Dongle communication error (ackStatus==None)] in state [1]