BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mangoh-drivers
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
mangoh-drivers
Commits
828cbe4e
Commit
828cbe4e
authored
Apr 02, 2019
by
David Frey
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
76fa5795
08a256f1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
24 deletions
+29
-24
component.c
apps/YellowSensorToCloud/components/sensors/bsec/component.c
+2
-2
CombainHttp.cpp
apps/locationService/combain/CombainHttp.cpp
+7
-6
location.c
apps/locationService/components/location.c
+20
-16
No files found.
apps/YellowSensorToCloud/components/sensors/bsec/component.c
View file @
828cbe4e
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
#include <jansson.h>
#include <jansson.h>
/// Input resource path
/// Input resource path
#define RES_PATH_VALUE "b
me
/value"
#define RES_PATH_VALUE "b
sec
/value"
#define RES_PATH_CONFIG "b
me
/config"
#define RES_PATH_CONFIG "b
sec
/config"
#define VALUE_EXAMPLE "{\"timestamp\":1,\"iaqValue\":1,\"iaqAccuracy\":1,\"co2EquivalentValue\":1,"\
#define VALUE_EXAMPLE "{\"timestamp\":1,\"iaqValue\":1,\"iaqAccuracy\":1,\"co2EquivalentValue\":1,"\
"\"co2EquivalentAccuracy\":1,\"breathVocValue\":1,\"breathVocAccuracy\":1,"\
"\"co2EquivalentAccuracy\":1,\"breathVocValue\":1,\"breathVocAccuracy\":1,"\
"\"pressure\":1,\"temperature\":1,\"humidity\":1 }"
"\"pressure\":1,\"temperature\":1,\"humidity\":1 }"
...
...
apps/locationService/combain/CombainHttp.cpp
View file @
828cbe4e
...
@@ -100,12 +100,13 @@ void *CombainHttpThreadFunc(void *context)
...
@@ -100,12 +100,13 @@ void *CombainHttpThreadFunc(void *context)
le_event_Report
(
ResponseAvailableEvent
,
NULL
,
0
);
le_event_Report
(
ResponseAvailableEvent
,
NULL
,
0
);
}
}
std
::
string
json
((
char
*
)
HttpReceiveBuffer
.
data
,
HttpReceiveBuffer
.
used
);
else
{
LE_INFO
(
"RECEIVED %d char: %s"
,
HttpReceiveBuffer
.
used
,
(
char
*
)
HttpReceiveBuffer
.
data
);
std
::
string
json
((
char
*
)
HttpReceiveBuffer
.
data
,
HttpReceiveBuffer
.
used
);
LE_INFO
(
"RECEIVED %d char: %s"
,
HttpReceiveBuffer
.
used
,
(
char
*
)
HttpReceiveBuffer
.
data
);
ResponseJson
->
enqueue
(
std
::
make_tuple
(
handle
,
json
));
ResponseJson
->
enqueue
(
std
::
make_tuple
(
handle
,
json
));
le_event_Report
(
ResponseAvailableEvent
,
NULL
,
0
);
le_event_Report
(
ResponseAvailableEvent
,
NULL
,
0
);
}
curl_easy_cleanup
(
curl
);
curl_easy_cleanup
(
curl
);
...
...
apps/locationService/components/location.c
View file @
828cbe4e
...
@@ -294,7 +294,7 @@ static void LocationResultHandler(
...
@@ -294,7 +294,7 @@ static void LocationResultHandler(
static
bool
TrySubmitRequest
(
void
)
static
bool
TrySubmitRequest
(
void
)
{
{
if
(
!
State
.
waitingForWifiResults
)
if
(
!
State
.
waitingForWifiResults
&&
State
.
waitingForCombainResults
==
false
)
{
{
LE_INFO
(
"Attempting to submit location request"
);
LE_INFO
(
"Attempting to submit location request"
);
const
le_result_t
res
=
ma_combainLocation_SubmitLocationRequest
(
const
le_result_t
res
=
ma_combainLocation_SubmitLocationRequest
(
...
@@ -369,17 +369,16 @@ static void WifiEventHandler(le_wifiClient_Event_t event, void *context)
...
@@ -369,17 +369,16 @@ static void WifiEventHandler(le_wifiClient_Event_t event, void *context)
if
(
res
!=
LE_OK
)
if
(
res
!=
LE_OK
)
{
{
LE_INFO
(
"Failed to append WiFi scan results to combain request
\n
"
);
LE_INFO
(
"Failed to append a WiFi scan result to combain request
\n
"
);
exit
(
1
);
}
}
ap
=
le_wifiClient_GetNextAccessPoint
();
ap
=
le_wifiClient_GetNextAccessPoint
();
}
}
if
(
WifiStarted
)
/*
if (WifiStarted)
{
{
le_wifiClient_Stop();
le_wifiClient_Stop();
WifiStarted = false;
WifiStarted = false;
}
}
*/
TrySubmitRequest
();
TrySubmitRequest
();
}
}
...
@@ -388,11 +387,11 @@ static void WifiEventHandler(le_wifiClient_Event_t event, void *context)
...
@@ -388,11 +387,11 @@ static void WifiEventHandler(le_wifiClient_Event_t event, void *context)
default:
default:
{
{
LE_INFO
(
"WiFi scan failed
\n
"
);
LE_INFO
(
"WiFi scan failed
\n
"
);
if
(
WifiStarted
)
/*
if (WifiStarted)
{
{
le_wifiClient_Stop();
le_wifiClient_Stop();
WifiStarted = false;
WifiStarted = false;
}
}
*/
ma_combainLocation_DestroyLocationRequest
(
State
.
combainHandle
);
ma_combainLocation_DestroyLocationRequest
(
State
.
combainHandle
);
State
.
waitingForWifiResults
=
false
;
State
.
waitingForWifiResults
=
false
;
UseGpsScan
();
UseGpsScan
();
...
@@ -450,8 +449,7 @@ static void Sample
...
@@ -450,8 +449,7 @@ static void Sample
GpsScan
=
&
SavedGpsScan
;
GpsScan
=
&
SavedGpsScan
;
}
}
if
(
!
State
.
waitingForWifiResults
)
{
if
(
!
State
.
waitingForWifiResults
&&
State
.
waitingForCombainResults
==
false
)
{
if
(
!
createdAccessPoint
)
if
(
!
createdAccessPoint
)
{
{
createdAccessPoint
=
le_wifiClient_Create
((
const
uint8_t
*
)
ssidPtr
,
strlen
(
ssidPtr
));
createdAccessPoint
=
le_wifiClient_Create
((
const
uint8_t
*
)
ssidPtr
,
strlen
(
ssidPtr
));
...
@@ -469,16 +467,22 @@ static void Sample
...
@@ -469,16 +467,22 @@ static void Sample
}
}
}
}
startRes
=
le_wifiClient_Start
();
if
(
WifiStarted
==
false
)
{
startRes
=
le_wifiClient_Start
();
if
(
startRes
!=
LE_OK
&&
startRes
!=
LE_BUSY
)
{
if
(
startRes
!=
LE_OK
&&
startRes
!=
LE_BUSY
)
{
LE_INFO
(
"Couldn't start the WiFi service error code: %s"
,
LE_RESULT_TXT
(
startRes
));
LE_INFO
(
"Couldn't start the WiFi service error code: %s"
,
LE_RESULT_TXT
(
startRes
));
WifiStarted
=
true
;
WifiStarted
=
false
;
}
else
WifiStarted
=
true
;
}
}
saved_ref
=
ref
;
if
(
WifiStarted
==
true
)
{
le_wifiClient_Scan
();
saved_ref
=
ref
;
State
.
waitingForWifiResults
=
true
;
le_wifiClient_Scan
();
State
.
waitingForWifiResults
=
true
;
}
}
}
else
else
LE_INFO
(
"le_wifiClient_Scan still RUNNING"
);
LE_INFO
(
"le_wifiClient_Scan still RUNNING"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment