Iot sdk thesis


Resolving the UNIX dependency



Download 2,28 Mb.
Pdf ko'rish
bet44/52
Sana26.04.2022
Hajmi2,28 Mb.
#584210
1   ...   40   41   42   43   44   45   46   47   ...   52
Bog'liq
EIT Thesis IoT SDK by Hrudaynath

Resolving the UNIX dependency: 
To resolve the dependency on 
sendto()
, we use 
socketSend()
provided by SODAQ NB-IoT API ( can be found in [31]). It requires ‘socket’, 
‘remote IP address’, ‘remote port’, ‘the data buffer to be sent’ and ‘the length of the data buffer’ 
as parameters. Now the send_data( ) looks like: 
int
send_data(dtls_connection_t *connP, 
uint8_t
* buffer, 
size_t
length) 

//Using socketSend to replace sendto
size_t
numBytes = connP->nbIOT->socketSend(connP->sock, connP-
>remoteIpStr,
connP->port, buffer, length); 
/*
*other source lines* 
*/
return
numBytes; 

/* -------------------------------------------------------------------------------
-- */


60 
/* Creates a dtls_connection_t pointer variable, loads it with the information 
needed to form the connection and Returns a pointer to a DTLS connection that is 
loaded with the details about the server*/
dtls_connection_t * connection_new_incoming(dtls_connection_t * connList, 
int
sock, 
const
struct
sockaddr * addr

size_t
addrLen) 

dtls_connection_t * connP; 
connP = (dtls_connection_t *)malloc(
sizeof
(dtls_connection_t)); 
if
(connP != 
NULL


memset(connP, 
0

sizeof
(dtls_connection_t)); 
connP->sock = sock; 
memcpy(&(connP->addr), addr, addrLen); 
connP->addrLen = addrLen; 
connP->next = connList; 
connP->dtlsSession = (session_t *)malloc(
sizeof
(session_t)); 
memset(connP->dtlsSession, 
0

sizeof
(session_t)); 
connP->dtlsSession->
addr.sin6 
= connP->addr; 
connP->dtlsSession->size = connP->addrLen; 
connP->lastSend = lwm2m_gettime(); 

return
connP; 


Download 2,28 Mb.

Do'stlaringiz bilan baham:
1   ...   40   41   42   43   44   45   46   47   ...   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