BigW Consortium Gitlab

Commit e3a42fb9 by David Frey

Update wakeupAndTweet to build with Legato 17.03.rc4

parent fb35e221
version: 1.1
version: 1.3
sandboxed: true
start: auto
......@@ -34,4 +34,5 @@ bindings:
wakeupAndTweet.wakeupAndTweet.le_adc -> modemService.le_adc
wakeupAndTweet.wakeupAndTweet.le_data -> dataConnectionService.le_data
wakeupAndTweet.wakeupAndTweet.le_avdata -> avcService.le_avdata
wakeupAndTweet.wakeupAndTweet.le_info -> modemService.le_info
}
\ No newline at end of file
......@@ -7,7 +7,8 @@ requires:
le_bootReason.api
le_adc.api
le_data.api
airVantage/le_avdata.api
airVantage/legacy/le_avdata.api
modemServices/le_info.api
}
}
......
......@@ -98,10 +98,7 @@ static void LightSensorSampleTimerHandler
LE_DEBUG("Light sensor reports value %d", lightSensorReading);
}
if (le_avdata_SetInt(LightSensorAsset, "Reading", lightSensorReading) != LE_OK)
{
LE_WARN("Couldn't publish light sensor reading");
}
le_avdata_SetInt(LightSensorAsset, "Reading", lightSensorReading);
if (lightSensorReading < ADC_LEVEL_SLEEP)
{
......@@ -109,23 +106,17 @@ static void LightSensorSampleTimerHandler
"Initiating shutdown due to light sensor value %d which is below the minimum %d",
lightSensorReading,
ADC_LEVEL_SLEEP);
if (le_ulpm_BootOnAdcConfigure(
if (le_ulpm_BootOnAdc(
LIGHT_SENSOR_ADC_NUM,
LIGHT_SENSOR_SAMPLE_INTERVAL_MS,
0,
0.0,
ADC_LEVEL_WAKEUP) != LE_OK)
{
LE_ERROR("Failed to configure ADC3 as a wakeup source");
return;
}
if (le_ulpm_BootOnAdcSetEnabled(LIGHT_SENSOR_ADC_NUM, true) != LE_OK)
{
LE_ERROR("Couldn't enable ADC3 as wakeup source");
return;
}
auto shutdownResult = le_ulpm_ShutDown();
switch (shutdownResult)
{
......@@ -168,8 +159,14 @@ COMPONENT_INIT
char emoji[emojiLength] = {0};
LE_ASSERT_OK(le_utf8_EncodeUnicodeCodePoint(UnicodeTiredFace, emoji, &emojiLength));
char dateTime[128];
LE_ASSERT_OK(le_clk_GetLocalDateTimeString(
LE_CLK_STRING_FORMAT_DATE_TIME, dateTime, sizeof(dateTime), NULL));
char imei[32];
LE_ASSERT_OK(le_info_GetImei(imei, sizeof(imei)));
std::ostringstream tweetStream;
tweetStream << emoji << " I'm just waking up at Sierra Wireless Developer Day 2016. #SierraDD2016";
tweetStream << emoji << " mangOH with IMEI=" << imei << " has woken up at " << dateTime;
auto tweet = std::make_shared<std::string>(tweetStream.str());
if (wakeupAndTweet_ConnectAndRun([tweet]{
SendTweet(tweet->c_str());
......
......@@ -8,7 +8,7 @@
apps:
{
// Platform services.
$LEGATO_ROOT/apps/platformServices/airVantage/avcService
$LEGATO_SERVICE_AVC_APP
$LEGATO_ROOT/apps/platformServices/cellNetService
$LEGATO_ROOT/apps/platformServices/dataConnectionService
$LEGATO_ROOT/apps/platformServices/fwupdateService
......@@ -17,6 +17,7 @@ apps:
$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
......@@ -30,7 +31,7 @@ apps:
commands:
{
cm = tools:/bin/cm
cm = tools:/scripts/cm
fwupdate = tools:/bin/fwupdate
secstore = tools:/bin/secstore
pmtool = tools:/bin/pmtool
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment