7 years, 11 months ago.

Communication protocol for between my data logger and a :NET C# application on PC

/media/uploads/mgvdatalogger/img_4790.jpg

Hello, I'm new to programming. I managed to program a data logger with 4 sensors and RTC and an serial flash on mbed platform. Right now i'm looking to establish communication between my logger with an PC-application (.NET). at this moment my logger can store the data into flash and then read them to serial terminal.

How can i send that serial data to .NET application?.

I knew i must use serial communication protocol for that. How to make the serial data in to frames like above image and get acknowledgements?. Do we have any examples on mbed? Thank you in advance.

1 Answer

7 years, 11 months ago.

your first block of request is 4 bytes (as 0x100FFFFF, let's name it START)

if your are shure the datas followinf will never produce this 4 bytes then, it's easy to made an protocol.

as you read the datas through serial, you can check whenever you get the START condition.

So from, you fill the buffer with then next bytes, you check with CRC, if it's okay you can accept it an then get back an answer.

you can do it in many ways.

can you show some example code ?.Thank you.

posted by Mohan gandhi Vinnakota 19 Aug 2016