Hi,
I'm trying to develop a simple ASCII API over UART using the nanoatmega328. So far, i'm able to send ascii commands from a terminal and receive it on arduino. I'm using serialCommands like this :
#define HOST_PROTOCOL_BUFFER_SIZE 100
#define HOST_PROTOCOL_TRAILER "\r"
#define HOST_PROTOCOL_DELIMITER " "
cmdParser = new SerialCommands(stream, cmdBuffer, HOST_PROTOCOL_BUFFER_SIZE, (char *) HOST_PROTOCOL_TRAILER, (char *) HOST_PROTOCOL_DELIMITER);
cmdParser->SetDefaultHandler(cmd_unknown);
cmdParser->AddCommand(&cmd_menuconfig);
cmdParser->AddCommand(&cmd_menucalibration);
cmdParser->AddCommand(&cmd_hib_1);
cmdParser->AddCommand(&cmd_hib_2);
cmdParser->AddCommand(&cmd_prf);
Then when I send a command matching cmd_prf the right function is called. I can access params through
void cmd_profile_handler(SerialCommands* sender)
{
Stream *stream = sender->GetSerial();
char *param;
char *valueStr;
param = sender->Next();
}
But when i'm sending a command with around 80 characters only the 66 first are received. When i'm typing it by hand there is no problem. I've set the SERIAL_COMMANDS_DEBUG in order to see char by char and the ouput is this :
//What i am sending :
//P W N DE Azerty (fast) AD 0 TR 180000 PO 30 AN 15 PS -130 PT 130 PE -10 SC 10000
//Output :
Read: bufLen=99 bufPos=0 termPos=0 ch=[P]
Read: bufLen=99 bufPos=1 termPos=0 ch=[ ]
Read: bufLen=99 bufPos=2 termPos=0 ch=[W]
Read: bufLen=99 bufPos=3 termPos=0 ch=[ ]
Read: bufLen=99 bufPos=4 termPos=0 ch=[N]
Read: bufLen=99 bufPos=5 termPos=0 ch=[ ]
Read: bufLen=99 bufPos=6 termPos=0 ch=[D]
Read: bufLen=99 bufPos=7 termPos=0 ch=[E]
Read: bufLen=99 bufPos=8 termPos=0 ch=[ ]
Read: bufLen=99 bufPos=9 termPos=0 ch=[A]
Read: bufLen=99 bufPos=10 termPos=0 ch=[z]
Read: bufLen=99 bufPos=11 termPos=0 ch=[e]
Read: bufLen=99 bufPos=12 termPos=0 ch=[r]
Read: bufLen=99 bufPos=13 termPos=0 ch=[t]
Read: bufLen=99 bufPos=14 termPos=0 ch=[y]
Read: bufLen=99 bufPos=15 termPos=0 ch=[ ]
Read: bufLen=99 bufPos=16 termPos=0 ch=[(]
Read: bufLen=99 bufPos=17 termPos=0 ch=[f]
Read: bufLen=99 bufPos=18 termPos=0 ch=[a]
Read: bufLen=99 bufPos=19 termPos=0 ch=[s]
Read: bufLen=99 bufPos=20 termPos=0 ch=[t]
Read: bufLen=99 bufPos=21 termPos=0 ch=[)]
Read: bufLen=99 bufPos=22 termPos=0 ch=[ ]
Read: bufLen=99 bufPos=23 termPos=0 ch=[A]
Read: bufLen=99 bufPos=24 termPos=0 ch=[D]
Read: bufLen=99 bufPos=25 termPos=0 ch=[ ]
Read: bufLen=99 bufPos=26 termPos=0 ch=[0]
Read: bufLen=99 bufPos=27 termPos=0 ch=[ ]
Read: bufLen=99 bufPos=28 termPos=0 ch=[T]
Read: bufLen=99 bufPos=29 termPos=0 ch=[R]
Read: bufLen=99 bufPos=30 termPos=0 ch=[ ]
Read: bufLen=99 bufPos=31 termPos=0 ch=[1]
Read: bufLen=99 bufPos=32 termPos=0 ch=[8]
Read: bufLen=99 bufPos=33 termPos=0 ch=[0]
Read: bufLen=99 bufPos=34 termPos=0 ch=[0]
Read: bufLen=99 bufPos=35 termPos=0 ch=[0]
Read: bufLen=99 bufPos=36 termPos=0 ch=[0]
Read: bufLen=99 bufPos=37 termPos=0 ch=[ ]
Read: bufLen=99 bufPos=38 termPos=0 ch=[P]
Read: bufLen=99 bufPos=39 termPos=0 ch=[O]
Read: bufLen=99 bufPos=40 termPos=0 ch=[ ]
Read: bufLen=99 bufPos=41 termPos=0 ch=[3]
Read: bufLen=99 bufPos=42 termPos=0 ch=[0]
Read: bufLen=99 bufPos=43 termPos=0 ch=[ ]
Read: bufLen=99 bufPos=44 termPos=0 ch=[A]
Read: bufLen=99 bufPos=45 termPos=0 ch=[N]
Read: bufLen=99 bufPos=46 termPos=0 ch=[ ]
Read: bufLen=99 bufPos=47 termPos=0 ch=[1]
Read: bufLen=99 bufPos=48 termPos=0 ch=[5]
Read: bufLen=99 bufPos=49 termPos=0 ch=[ ]
Read: bufLen=99 bufPos=50 termPos=0 ch=[P]
Read: bufLen=99 bufPos=51 termPos=0 ch=[S]
Read: bufLen=99 bufPos=52 termPos=0 ch=[ ]
Read: bufLen=99 bufPos=53 termPos=0 ch=[-]
Read: bufLen=99 bufPos=54 termPos=0 ch=[1]
Read: bufLen=99 bufPos=55 termPos=0 ch=[3]
Read: bufLen=99 bufPos=56 termPos=0 ch=[0]
Read: bufLen=99 bufPos=57 termPos=0 ch=[ ]
Read: bufLen=99 bufPos=58 termPos=0 ch=[P]
Read: bufLen=99 bufPos=59 termPos=0 ch=[T]
Read: bufLen=99 bufPos=60 termPos=0 ch=[ ]
Read: bufLen=99 bufPos=61 termPos=0 ch=[1]
Read: bufLen=99 bufPos=62 termPos=0 ch=[3]
Read: bufLen=99 bufPos=63 termPos=0 ch=[0]
Read: bufLen=99 bufPos=64 termPos=0 ch=[ ]
Read: bufLen=99 bufPos=65 termPos=0 ch=[P]
Read: bufLen=99 bufPos=66 termPos=0 ch=[S]
If anyone has any clue where the problem is ?
Thanks !