officinerobotiche / uNAV.X

Project MPLABX for drive uNAV on dsPIC33
http://rnext.it/project/unav/
MIT License
9 stars 2 forks source link

Dynamic packet #34

Open rbonghi opened 9 years ago

rbonghi commented 9 years ago

A problem in current release of protocol communication is not possible to send or receive a dynamic packet.

To solve, we will find a new way to decode a message, without use a hashmap and on parse_packet() use a pointer to save datas:

    information_packet_t list_data[BUFFER_LIST_PARSING];
    unsigned int counter = 0;
    //Save single packet
    for (i = 0; i < receive_pkg.length; i += receive_pkg.buffer[i]) {
        memcpy((unsigned char*) &list_data[counter++], &receive_pkg.buffer[i], receive_pkg.buffer[i]);
    }