ATIM ACW-RPI 사용자 설명서 - 페이지 7
{카테고리_이름} ATIM ACW-RPI에 대한 사용자 설명서을 온라인으로 검색하거나 PDF를 다운로드하세요. ATIM ACW-RPI 10 페이지. Cloud wireless
Example « Hello world » with the API ARMAPI in C
The below example sends the message« Hello world » to a selected radio network.
1.
//Include API
2.
#include <arm.h>
3.
//Instance of ARM class
4.
Arm myArm;
5.
//The message to sand
6.
uint8_t msg[] =
7.
8.
int
main()
9.
{
10.
//Initialize of API and check the error code.
11.
if
(armInit(&myArm, "/dev/ttyAMA0") != ARM_ERR_NONE)
12.
return 1;
13.
14.
//If we want use the Sigfox network:
15.
armSetMode(&myArm, ARM_MODE_SFX);
16.
//If we want use the LoraWan network:
17.
//armSetMode(&myArm, ARM_MODE_LORAWAN);
18.
//If we want use the local mode:
19.
//armSetMode(&myArm, ARM_MODE_SFK);
20.
21.
//After to send the message, we need to send the configuration to the radio modem.
22.
armUpdateConfig(&myArm);
23.
24.
//Send of message.
25.
armSend(&myArm, msg, sizeof(msg)-1);
26.
27.
return 0;
28.
}
For more details/information/examples please see the documentation of library
http://atim-radiocommunications.github.io/armapi/doc/html/index.html
"Hello
world";
EN-UG ACW – RPI | ATIM
7