Iot sdk thesis


Resolving the UNIX dependency



Download 2,28 Mb.
Pdf ko'rish
bet46/52
Sana26.04.2022
Hajmi2,28 Mb.
#584210
1   ...   42   43   44   45   46   47   48   49   ...   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: 

Remove the parameters that depend on UNIX libraries 

Pass 
int sock 
to compensate for deleted address parameters

Compare socket field from the passed DTLS connection structure with the socket 
passed as parameter
dtls_connection_t * connection_find(dtls_connection_t * connList, 
int
sock) 

dtls_connection_t * connP; 
connP = connList; 
while
(connP != 
nullptr
){ 

/* Compare the passed socket parameter with the socket field in the passed 
connection parameter, return the currently loaded connection if they 
match*/
if
(connP->sock == sock) 

return
connP; 

connP = connP->next; 

return
connP; 

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


63 
So, in this chapter, we saw how the UNIX-specific dependencies in tinydtls library have 
been removed using SODAQ NB-IoT API and other logically equivalent adjustments and 
substitutions. 
3.3.4
 
Integration to Wakaama and other changes 
In section 3.3.1, we talked about making tinydtls library compatible with the Arduino-
like SODAQ SARA board. In this section, we explain the changes or additions required to be 
made to rest of the Wakaama to integrate the now compatible tinydtls library. 
A LWM2M DTLS client has to have an exclusive pair of pre-shared key (PSK) and 
PSK ID, to be uniquely identifiable to the LWM2M server. We define
char * pskId 
and 
char 
* psk 
as the private members of 
class ArduinoClient
as shown in the code snippet below. 
We also have to define the unique client name. It has been defined alongside network-specific 
parameters. 


64 
class
ArduinoClient { 
public:
/* 
Other variables and functions 
*/
private:
/* 
Other variables 
*/ 
const
char
* serverIP = 
"23.97.187.154"

// Eclipse Leshan Server
#ifdef WITH_TINYDTLS 
/*DTLS Credentials, psk must be in HEX format */
char
* pskId = (
char
*) 
"SODAQWakaamaDTLS"

char
* psk = (
char
*) 
"abcd"

/*A buffer to parse the DTLS credentials */
uint16_t
pskLen = strlen(psk)/
2

char
* pskBuffer = (
char
*) lwm2m_malloc(pskLen); 
/*DTLS remote port*/
const
char
* serverPort = 
"5684"
;
#else 
//non-DTLS remote port
const
char
* serverPort = 
"5683"
;
#endif 
/* 
Other variables 
*/
}; 
/* In main.cpp, defined as global variables */
#define WITH_TINYDTLS
const
char
* apn = 
"u.iot.mt.gr.hu"

const
char
* cdp = 
NULL

const
uint8_t
cid = 
1
;
const
uint8_t
band = 
20
;
const
char
* forceOperator = 
"21630"

#ifdef WITH_TINYDTLS
const
char
* lwm2mEndpoint = 
"SODAQWakaamaDTLS"

#else
const
char
* lwm2mEndpoint = 
"NO-DTLS-Client"

#endif
Whenever the Wakaama client with a set of credentials tries to establish a DTLS 
connection with LWM2M server, the server verifies the credentials by checking them against 
the stored configurations of the credentials. If the verification is successful, the certificate 
transfer is initiated. 


65 
So, the credentials have to be added to the server before we ask the client to connect. 
For the thesis, I used Eclipse Leshan as a LWM2M server.

Download 2,28 Mb.

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