Iot sdk thesis



Download 2,28 Mb.
Pdf ko'rish
bet33/52
Sana26.04.2022
Hajmi2,28 Mb.
#584210
1   ...   29   30   31   32   33   34   35   36   ...   52
Bog'liq
EIT Thesis IoT SDK by Hrudaynath

Method 
Description 
getSaraR4Baudrate() 
Returns the correct baudrate for the serial 
port that connects to SARA R4XX 
device
setDiag (Stream& stream)
 
Sets the optional "Diagnostics and 
Debug" stream. 
init(Stream& stream, int8_t onoffPin,
Stream& 
stream, int8_t onoffPin, int8_t txEnablePin, 
int8_t saraR4XXTogglePin, uint8_t cid)
 
Initializes the modem instance. Sets the 
modem stream and the on-off power 
pins. 
createSocket(uint16_t localPort = 0) 
Create a UDP socket for the specified 
local port, returns the socket handle. 
connect(const char* apn, const char* cdp, const 
char* forceOperator = 0, uint8_t band = 8) 
Turns on and initializes the modem, then 
connects to the network and activates the 
data connection. Returns true when 
successful. 
socketSend(uint8_t socket, const char* 
remoteIP, const uint16_t remotePort, const 
uint8_t* buffer, size_t size)
 
Send a UDP payload buffer to a 
specified remote IP and port, through a 
specific socket. 
Table 3.1.2.1.1 SODAQ NB-IoT API 
[31]
 


42 
The code snippet below shows different methods used from API to implement the UPD 
messaging over NB-IoT 
//Define the operator-specific settings
const
char
* apn = 
"u.iot.mt.gr.hu"

//The operator

s pre-commercial NB-IOT APN
const
char
* cdp = 
NULL
;
const
uint8_t cid = 
1

const
uint8_t band = 
20

//LTE band 20 (Uplink: 832 MHz 

862MHz; Downlink: 
791 

821) 
const
char
* forceOperator = 
"21630"

Sodaq_nbIOT nbiot; 
//Create an object to access the API methods
void
setup()

/*Connect to the NB-IoT Network*/
DEBUG_STREAM.print(
"Initializing and connecting... "
);
while
(!nbiot.connect(apn, cdp, forceOperator, band)); 
DEBUG_STREAM.println(
"Connected succesfully!"
);
/*Open a UDP Socket*/
while
(!openSocketUDP());
/*Send a string to a remote IP and port*/
nbiot.socketSend(socketID, 
"165.227.145.200"

41243

"SODAQ UDP Packet"
);

/*A custom-made function to open a UDP socket*/
int
openSocketUDP()

/*A open a socket at local port 0*/
socketID = nbiot.createSocket(0); 
/*NB-IoT module assigns a socket ID, valid values are 0 to 6*/
if
(socketID >= 
7
|| socketID < 
0
)
{
DEBUG_STREAM.println(
"Failed to create socket"
);
return
0
;

else

DEBUG_STREAM.println(
"Created socket at"
);
DEBUG_STREAM.println(socketID); 
return
1
;




43 
Results 
The state of debug serial terminal during the run-time and the received message 
“SODAQ 
UDP PACKET”
at remote IP is shown below. 

Download 2,28 Mb.

Do'stlaringiz bilan baham:
1   ...   29   30   31   32   33   34   35   36   ...   52




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish