CongducPham / LowCostLoRaGw

Low-cost LoRa IoT & gateway with SX12XX (SX1261/62/68; SX1272/76/77/78/79; SX1280/81), RaspberryPI and Arduino boards
701 stars 352 forks source link

getCmdValue #22

Open x893 opened 8 years ago

x893 commented 8 years ago

Hi, can you say about return value from getCmdValue function (Arduino_LoRa_Gateway.ino) if strBuff not NULL ?

Thanks

CongducPham commented 8 years ago

If strbuff is not NULL then you will get the string in strbuf and not a long value. Ex:

Hello# -> you will get "Hello" in strbuf

23# -> you will get the 23 (long) as a return value.

regards,

Le 17/07/16 17:16, Mitek a écrit :

Hi, can you say about return value from getCmdValue function (Arduino_LoRa_Gateway.ino) if strBuff not NULL ?

Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/CongducPham/LowCostLoRaGw/issues/22, or mute the thread https://github.com/notifications/unsubscribe-auth/ABNENy_3G8Xh9mw3Sp5tXek1pSn3MsSpks5qWkdOgaJpZM4JOPmC.

C. Pham.

------------ Congduc PHAM - Professor -------------------------- LIUPPA - Equipe T2I U.P.P.A. Pau http://liuppa.univ-pau.fr/ http://www.univ-pau.fr
UPPA, LIUPPA laboratory, UFR Sciences et Techniques
Avenue de l'Université - BP 1155
64013 PAU CEDEX, FRANCE
phone: 33 5 59 40 75 94
fax: 33 5 59 40 76 54
Congduc.Pham@univ-pau.fr http://www.univ-pau.fr/~cpham
----------------------------------------------------------------
x893 commented 8 years ago

As i see if (strBuff) { strcpy(strBuff, seqStr);
} else return (atol(seqStr)); }

return value undefined. gcc ignore this situation but armcc say warning - and better if no unpredicted situation. Also some warnings in sx1272 library.

for getCmdValue logically add return 0; before last }

CongducPham commented 8 years ago

You're right, better to return something. Thanks,

regards,

Le 17/07/16 21:36, Mitek a écrit :

As i see if (strBuff) { strcpy(strBuff, seqStr);

} else return (atol(seqStr)); }

return value undefined. gcc ignore this situation but armcc say warning - and better if no unpredicted situation. Also some warnings in sx1272 library.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/CongducPham/LowCostLoRaGw/issues/22#issuecomment-233199616, or mute the thread https://github.com/notifications/unsubscribe-auth/ABNEN6MBHLs8E2bIc4ad6IrQAzo9yGX-ks5qWoRPgaJpZM4JOPmC.

C. Pham.

------------ Congduc PHAM - Professor -------------------------- LIUPPA - Equipe T2I U.P.P.A. Pau http://liuppa.univ-pau.fr/ http://www.univ-pau.fr
UPPA, LIUPPA laboratory, UFR Sciences et Techniques
Avenue de l'Université - BP 1155
64013 PAU CEDEX, FRANCE
phone: 33 5 59 40 75 94
fax: 33 5 59 40 76 54
Congduc.Pham@univ-pau.fr http://www.univ-pau.fr/~cpham
----------------------------------------------------------------