Iot sdk thesis


Resolving the UNIX dependency



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

Resolving the UNIX dependency: 
To make this function compatible on SODAQ SARA, the 
following changes had to be made: 

Change the parameters passed: remove 
const struct sockaddr * addr, size_t 
addrLen
,
add 
Sodaq_nbIOT * nbIOT, char * remoteIpStr, uint16_t port
Design Decision:

The removed parameter 


sockaddr * addr
requires UNIX library 
 
, the purpose of which is to hold the remote IP address. To serve this 
purpose, we pass 
char * remoteIpStr 
and 
uint16_t port
which can sufficiently 
define the remote server location. A pointer to variable is passed so that we can set the 
appropriate SODAQ NB-IoT API compliant fields in the to-be returned connection 
pointer. 

Remove the lines that use removed parameters and replace them with new equivalents 

Set the Sodaq_nbIOT variable of newly created connection to the address pointer to by 
the variable passed as parameter 


61 
dtls_connection_t * connection_new_incoming(dtls_connection_t * connList,
int
sock,
Sodaq_nbIOT * nbIOT, 
char
* remoteIpStr, 
uint16_t
port) 

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

{
memset(connP, 
0

sizeof
(dtls_connection_t)); 
//Fills connP with 0s 
// memcpy(&(connP->addr), addr, addrLen);
// connP->addrLen = addrLen;
// connP->next = connList;
int
remoteIpLen = strlen(remoteIpStr)+
1

//Added
connP->remoteIpStr = (
char
*)malloc(remoteIpLen); 
//Added
strncpy(connP->remoteIpStr, remoteIpStr, remoteIpLen); 
//Added
//Added for SODAQ, set the nbIOT object of new connection as the object 
passed as parameter
connP->nbIOT = nbIOT;
/*
*other source lines* 
*/
//connP->dtlsSession->addr.sin6 = connP->remoteIpStr;
//connP->dtlsSession->addr.sin = connP->remoteIpStr; 
connP->dtlsSession->addr.remoteIpStr = connP->remoteIpStr; 
//Added for 
SODAQ
connP->dtlsSession->size = remoteIpLen; 
/* 
*other source lines* 
*/

return
connP; 

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


62 
/* Compare ConnList->addr with addr until they match, and return connList address 
if they are same, else return NULL */
dtls_connection_t * connection_find(dtls_connection_t * connList, 
const
struct
sockaddr_storage * addr, 
size_t addrLen) 

dtls_connection_t * connP; 
connP = connList; 
while
(connP != 
NULL

{
/* Compare the passed address parameter with the address field in the 
passed connection parameter, return the currently loaded connection if they 
match*/
if
(
sockaddr_cmp
((
struct
sockaddr
*) (&connP->addr),(
struct
sockaddr
*) 
addr))
return
connP; 
connP = connP->next; 

return
connP; 
}

Download 2,28 Mb.

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