Crtp Protocol - connection procedure between client and CF

Firmware/software/electronics/mechanics
Post Reply
Nyothan
Beginner
Posts: 15
Joined: Tue Feb 10, 2015 4:36 pm

Crtp Protocol - connection procedure between client and CF

Post by Nyothan »

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:

Code: Select all

typedef enum {
  linkEcho   = 0x00,
  linkSource = 0x01,
  linkSink   = 0x02,
} LinkNbr;
And they are serviced like this in the crtp packet handler:

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;
  } 
}
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:

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]
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)?
Nyothan
Beginner
Posts: 15
Joined: Tue Feb 10, 2015 4:36 pm

Re: Crtp Protocol - connection procedure between client and

Post by Nyothan »

I forgot to mention that I didn't rewrite the LOG/Param subsystem yet: thus, I don't send the TOC to the python client when starting. I don't know if it's mandatory for the client to get the TOC at start...

Thanks in advance for your answers :)
Post Reply