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
d6d04f0b
Commit
d6d04f0b
authored
Sep 13, 2017
by
David Clark
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
ssh://github.com/mangOH/mangOH
parents
f4da3719
3ee97de2
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
137 additions
and
72 deletions
+137
-72
ArduinoBridge
apps/ArduinoBridge
+1
-1
DataRouter
apps/DataRouter
+1
-1
GpioExpander
apps/GpioExpander
+1
-1
Heartbeat
apps/Heartbeat
+1
-1
MqttClient
apps/MqttClient
+1
-1
MuxControl
apps/MuxControl
+1
-1
RedSensorToCloud
apps/RedSensorToCloud
+1
-1
SocialService
apps/SocialService
+1
-1
mangOH_Green.sdef
mangOH_Green.sdef
+8
-0
mangOH_Red.sdef
mangOH_Red.sdef
+7
-0
Demos
samples/Demos
+1
-1
RelayControl
samples/RelayControl
+1
-1
Component.cdef
...developerDay2016/components/wakeupAndTweet/Component.cdef
+2
-14
main.cpp
...s/developerDay2016/components/wakeupAndTweet/src/main.cpp
+95
-6
developerDay2016.sdef
samples/tutorials/developerDay2016/developerDay2016.sdef
+3
-30
Component.cdef
...H_Green/adc/NoiseSensor/noiseDataComponent/Component.cdef
+1
-1
Component.cdef
...pio/Cf3GpioControl/cf3GpioControlComponent/Component.cdef
+2
-2
Component.cdef
...ngOH_Green/gpio/TimerLed/timerLedComponent/Component.cdef
+1
-1
Component.cdef
..._Green/gpio/TouchSensor/touchDataComponent/Component.cdef
+2
-2
Component.cdef
...gOH_Red/adc/NoiseSensor/noiseDataComponent/Component.cdef
+1
-1
Component.cdef
...pio/Cf3GpioControl/cf3GpioControlComponent/Component.cdef
+2
-2
Component.cdef
...mangOH_Red/gpio/TimerLed/timerLedComponent/Component.cdef
+1
-1
Component.cdef
...OH_Red/gpio/TouchSensor/touchDataComponent/Component.cdef
+2
-2
No files found.
ArduinoBridge
@
699e500a
Subproject commit
76f7560f98cb96b7e3f05797cfbdee0ed3f42c6b
Subproject commit
699e500ad32aaad5799a8b7e7b4244f67a13407a
DataRouter
@
e8395ae6
Subproject commit e
4ae027c9f447f84723f3fc1c872875166840cfa
Subproject commit e
8395ae650c66c1ce044b7da7ea77a1e5e366171
GpioExpander
@
96ca0364
Subproject commit
84b40089f470cd0574ca72bf1943c3bcb6f2842d
Subproject commit
96ca0364ccaf4c5ff8c7d6feaeb984c6958a6cf1
Heartbeat
@
5b471995
Subproject commit
6966f104db935ff771dcce229647255f0bb01fa2
Subproject commit
5b471995d594827c55cb7939b7e048b207080d68
MqttClient
@
6b24c677
Subproject commit
3c5de16d8c8390eb56b4961273877da43773f888
Subproject commit
6b24c67721832748c25d9a62751690afe52ed6fc
MuxControl
@
e71865bd
Subproject commit
24f0dc8aa1e2c19a6ac272d65be8a2e3085472e6
Subproject commit
e71865bdd0cf367c99cdbaf62328ae230122ff27
RedSensorToCloud
@
a16c7383
Subproject commit
60da5e1c03b694ce9b45ccd61f67a4bfa3f0fee2
Subproject commit
a16c7383f9077cde0249802931af12802313af2d
SocialService
@
d9bc976e
Subproject commit
7f669131d16ce30e05ef8406651a7a0965a6b8a4
Subproject commit
d9bc976e11679435d53734538b96cdd69c84856a
mangOH_Green.sdef
View file @
d6d04f0b
...
...
@@ -31,6 +31,14 @@ commands:
twitter = socialService:/bin/twitter
}
interfaceSearch:
{
$MANGOH_ROOT/apps/MqttClient
$MANGOH_ROOT/apps/DataRouter
$MANGOH_ROOT/apps/MuxControl
$MANGOH_ROOT/apps/SocialService/interfaces
}
kernelModules:
{
$MANGOH_ROOT/linux_kernel_modules/mangoh/9-mangoh_green_dv4
...
...
mangOH_Red.sdef
View file @
d6d04f0b
...
...
@@ -31,6 +31,13 @@ commands:
twitter = socialService:/bin/twitter
}
interfaceSearch:
{
$MANGOH_ROOT/apps/MqttClient
$MANGOH_ROOT/apps/DataRouter
$MANGOH_ROOT/apps/MuxControl
$MANGOH_ROOT/apps/SocialService/interfaces
}
kernelModules:
{
...
...
Demos
@
74a620c3
Subproject commit 7
6962746606a8360c2030476ab8e25d072743a99
Subproject commit 7
4a620c30e78d56f0e38d1d752cd829df963a112
RelayControl
@
024ec5e4
Subproject commit
d8b9d40379bbc3ebdd12cb6a3e812283f6589253
Subproject commit
024ec5e45b5771a83c763a1d8125f6eaf83d02a8
samples/tutorials/developerDay2016/components/wakeupAndTweet/Component.cdef
View file @
d6d04f0b
...
...
@@ -2,12 +2,12 @@ requires:
{
api:
{
${MANGOH_ROOT}/apps/SocialService/interfaces/
twitter.api
twitter.api
le_ulpm.api
le_bootReason.api
le_adc.api
le_data.api
airVantage/le
gacy/le
_avdata.api
airVantage/le_avdata.api
modemServices/le_info.api
}
}
...
...
@@ -22,14 +22,3 @@ cxxflags:
{
-std=c++11
}
assets:
{
LightSensor =
{
variables:
{
int Reading
}
}
}
\ No newline at end of file
samples/tutorials/developerDay2016/components/wakeupAndTweet/src/main.cpp
View file @
d6d04f0b
...
...
@@ -21,12 +21,24 @@
#define LIGHT_SENSOR_SAMPLE_INTERVAL_MS 2000
static
void
SendTweet
(
const
char
*
tweet
);
static
void
LightSensorSampleTimerHandler
(
le_timer_Ref_t
sampleTimer
);
static
void
PushCallbackHandler
(
le_avdata_PushStatus_t
status
,
void
*
context
);
static
void
AvSessionStateHandler
(
le_avdata_SessionState_t
state
,
void
*
context
);
static
void
TryStartTimer
(
void
);
static
const
uint32_t
UnicodeTiredFace
=
0x1F62B
;
static
const
uint32_t
UnicodeSleepingFace
=
0x1F634
;
static
le_avdata_RequestSessionObjRef_t
AvSession
;
static
le_timer_Ref_t
LightSensorSampleTimer
;
static
bool
TweetPending
=
false
;
static
bool
AvDataSessionActive
=
false
;
static
uint32_t
PushCount
=
0
;
static
uint32_t
ShutdownAfterPush
=
0
;
static
le_avdata_AssetInstanceRef_t
LightSensorAsset
;
static
const
char
*
LightSensorReadingResource
=
"lightSensor/reading"
;
//--------------------------------------------------------------------------------------------------
...
...
@@ -73,6 +85,7 @@ static void SendTweet
LE_FATAL
(
"Unhandled tweet result (%d)"
,
r
);
}
}
while
(
attempts
<
3
);
TweetPending
=
false
;
}
//--------------------------------------------------------------------------------------------------
...
...
@@ -98,15 +111,50 @@ static void LightSensorSampleTimerHandler
LE_DEBUG
(
"Light sensor reports value %d"
,
lightSensorReading
);
}
le_avdata_SetInt
(
LightSensorAsset
,
"Reading"
,
lightSensorReading
);
if
(
lightSensorReading
<
ADC_LEVEL_SLEEP
)
{
ShutdownAfterPush
=
PushCount
+
1
;
LE_INFO
(
"Initiating shutdown due to light sensor value %d which is below the minimum %d"
,
lightSensorReading
,
ADC_LEVEL_SLEEP
);
}
auto
setIntRes
=
le_avdata_SetInt
(
LightSensorReadingResource
,
lightSensorReading
);
if
(
setIntRes
!=
LE_OK
)
{
LE_WARN
(
"Failed to set light sensor resource"
);
}
else
{
PushCount
++
;
le_avdata_Push
(
LightSensorReadingResource
,
PushCallbackHandler
,
(
void
*
)
PushCount
);
}
}
static
void
PushCallbackHandler
(
le_avdata_PushStatus_t
status
,
///< push status
void
*
context
///< The push count when the push was submitted
)
{
switch
(
status
)
{
case
LE_AVDATA_PUSH_SUCCESS
:
break
;
case
LE_AVDATA_PUSH_FAILED
:
LE_WARN
(
"Failed to push push_button state"
);
break
;
default:
LE_FATAL
(
"Unexpected push status"
);
break
;
}
if
((
uint32_t
)
context
==
ShutdownAfterPush
)
{
if
(
le_ulpm_BootOnAdc
(
LIGHT_SENSOR_ADC_NUM
,
LIGHT_SENSOR_SAMPLE_INTERVAL_MS
,
...
...
@@ -139,12 +187,51 @@ static void LightSensorSampleTimerHandler
}
}
static
void
AvSessionStateHandler
(
le_avdata_SessionState_t
state
,
void
*
context
)
{
switch
(
state
)
{
case
LE_AVDATA_SESSION_STARTED
:
LE_DEBUG
(
"AVData session started"
);
AvDataSessionActive
=
true
;
TryStartTimer
();
break
;
case
LE_AVDATA_SESSION_STOPPED
:
LE_INFO
(
"AVData session stopped. Push will fail."
);
AvDataSessionActive
=
false
;
le_timer_Stop
(
LightSensorSampleTimer
);
break
;
default:
LE_FATAL
(
"Unsupported AV session state %d"
,
state
);
break
;
}
}
static
void
TryStartTimer
(
void
)
{
if
(
AvDataSessionActive
&&
!
TweetPending
)
{
LE_ASSERT_OK
(
le_timer_Start
(
LightSensorSampleTimer
));
}
}
COMPONENT_INIT
{
LE_DEBUG
(
"wakeupAndTweetApp started"
);
LightSensorAsset
=
le_avdata_Create
(
"LightSensor"
);
le_result_t
r
=
le_avdata_CreateResource
(
LightSensorReadingResource
,
LE_AVDATA_ACCESS_VARIABLE
);
LE_FATAL_IF
(
r
!=
LE_OK
&&
r
!=
LE_DUPLICATE
,
"Couldn't create resource for light sensor reading"
);
le_avdata_AddSessionStateHandler
(
AvSessionStateHandler
,
NULL
);
AvSession
=
le_avdata_RequestSession
();
LE_FATAL_IF
(
AvSession
==
NULL
,
"Failed to request avdata session"
);
LightSensorSampleTimer
=
le_timer_Create
(
"light sensor"
);
LE_ASSERT_OK
(
le_timer_SetHandler
(
LightSensorSampleTimer
,
LightSensorSampleTimerHandler
));
...
...
@@ -168,18 +255,20 @@ COMPONENT_INIT
std
::
ostringstream
tweetStream
;
tweetStream
<<
emoji
<<
" mangOH with IMEI="
<<
imei
<<
" has woken up at "
<<
dateTime
;
auto
tweet
=
std
::
make_shared
<
std
::
string
>
(
tweetStream
.
str
());
TweetPending
=
true
;
if
(
wakeupAndTweet_ConnectAndRun
([
tweet
]{
SendTweet
(
tweet
->
c_str
());
LE_ASSERT_OK
(
le_timer_Start
(
LightSensorSampleTimer
)
);
TryStartTimer
(
);
})
!=
LE_OK
)
{
TweetPending
=
false
;
LE_ERROR
(
"Couldn't create data connection to send tweet"
);
LE_ASSERT_OK
(
le_timer_Start
(
LightSensorSampleTimer
)
);
TryStartTimer
(
);
}
}
else
{
LE_DEBUG
(
"Boot reason was not ADC %u"
,
LIGHT_SENSOR_ADC_NUM
);
LE_ASSERT_OK
(
le_timer_Start
(
LightSensorSampleTimer
)
);
TryStartTimer
(
);
}
}
samples/tutorials/developerDay2016/developerDay2016.sdef
View file @
d6d04f0b
...
...
@@ -5,47 +5,20 @@
// Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.
//--------------------------------------------------------------------------------------------------
#include "$LEGATO_ROOT/default.sdef"
apps:
{
// Platform services.
$LEGATO_SERVICE_AVC_APP
$LEGATO_ROOT/apps/platformServices/cellNetService
$LEGATO_ROOT/apps/platformServices/dataConnectionService
$LEGATO_ROOT/apps/platformServices/fwupdateService
$LEGATO_ROOT/apps/platformServices/modemService
$LEGATO_ROOT/apps/platformServices/positioningService
$LEGATO_ROOT/apps/platformServices/powerMgr
$LEGATO_ROOT/apps/platformServices/secStore
$LEGATO_ROOT/apps/platformServices/gpioService
$LEGATO_ROOT/apps/platformServices/fsService
$LEGATO_ROOT/apps/sample/lwm2mAirVantageControl/lwm2mControl
$MANGOH_ROOT/apps/SocialService/socialService
// Command-line tools.
$LEGATO_ROOT/apps/tools/tools
$MANGOH_ROOT/samples/tutorials/developerDay2016/apps/wakeupAndTweet
}
commands:
{
cm = tools:/scripts/cm
fwupdate = tools:/bin/fwupdate
secstore = tools:/bin/secstore
pmtool = tools:/bin/pmtool
twitter = socialService:/bin/twitter
}
bindings:
{
<root>.le_fwupdate -> fwupdateService.le_fwupdate
}
interfaceSearch:
{
interfaces/modemServices
interfaces/positioning
$MANGOH_ROOT/apps/SocialService/interfaces
}
samples/tutorials/mangOH_Green/adc/NoiseSensor/noiseDataComponent/Component.cdef
View file @
d6d04f0b
...
...
@@ -2,7 +2,7 @@ requires:
{
api:
{
${LEGATO_ROOT}/interfaces/
modemServices/le_adc.api
modemServices/le_adc.api
}
}
...
...
samples/tutorials/mangOH_Green/gpio/Cf3GpioControl/cf3GpioControlComponent/Component.cdef
View file @
d6d04f0b
...
...
@@ -2,8 +2,8 @@ requires:
{
api:
{
le_sensorGpio =
${LEGATO_ROOT}/interfaces/
le_gpio.api
mangoh_ledGpio =
${LEGATO_ROOT}/interfaces/
le_gpio.api
le_sensorGpio = le_gpio.api
mangoh_ledGpio =le_gpio.api
}
}
...
...
samples/tutorials/mangOH_Green/gpio/TimerLed/timerLedComponent/Component.cdef
View file @
d6d04f0b
...
...
@@ -2,7 +2,7 @@ requires:
{
api:
{
mangoh_ledGpio =
${LEGATO_ROOT}/interfaces/
le_gpio.api
mangoh_ledGpio = le_gpio.api
}
}
...
...
samples/tutorials/mangOH_Green/gpio/TouchSensor/touchDataComponent/Component.cdef
View file @
d6d04f0b
...
...
@@ -2,8 +2,8 @@ requires:
{
api:
{
mangoh_ledGpio =
${LEGATO_ROOT}/interfaces/
le_gpio.api
mangoh_pushButton =
${LEGATO_ROOT}/interfaces/
le_gpio.api
mangoh_ledGpio = le_gpio.api
mangoh_pushButton = le_gpio.api
}
}
...
...
samples/tutorials/mangOH_Red/adc/NoiseSensor/noiseDataComponent/Component.cdef
View file @
d6d04f0b
...
...
@@ -2,7 +2,7 @@ requires:
{
api:
{
${LEGATO_ROOT}/interfaces/
modemServices/le_adc.api
modemServices/le_adc.api
}
}
...
...
samples/tutorials/mangOH_Red/gpio/Cf3GpioControl/cf3GpioControlComponent/Component.cdef
View file @
d6d04f0b
...
...
@@ -2,8 +2,8 @@ requires:
{
api:
{
le_sensorGpio =
${LEGATO_ROOT}/interfaces/
le_gpio.api
mangoh_ledGpio =
${LEGATO_ROOT}/interfaces/
le_gpio.api
le_sensorGpio = le_gpio.api
mangoh_ledGpio = le_gpio.api
}
}
...
...
samples/tutorials/mangOH_Red/gpio/TimerLed/timerLedComponent/Component.cdef
View file @
d6d04f0b
...
...
@@ -2,7 +2,7 @@ requires:
{
api:
{
mangoh_ledGpio =
${LEGATO_ROOT}/interfaces/
le_gpio.api
mangoh_ledGpio = le_gpio.api
}
}
...
...
samples/tutorials/mangOH_Red/gpio/TouchSensor/touchDataComponent/Component.cdef
View file @
d6d04f0b
...
...
@@ -2,8 +2,8 @@ requires:
{
api:
{
mangoh_ledGpio =
${LEGATO_ROOT}/interfaces/
le_gpio.api
mangoh_pushButton =
${LEGATO_ROOT}/interfaces/
le_gpio.api
mangoh_ledGpio = le_gpio.api
mangoh_pushButton = le_gpio.api
}
}
...
...
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