assetData and GPIO


#1

Hello,

I want to activate the GPIO 21 from wp8548 via command in airvantage.

In order to do that, I want to use the gpioService, juts like this app does: https://github.com/legatoproject/legato-af/tree/master/apps/sample/gpioCf3Demo

I’m writing my code based on this app: https://github.com/nhonchu/Legato16.10-AssetData

I want to use GPIOService in the AssetData sample.

I tried this:

  1. changed assetDataTutorial.adef to:

  2. changed the component.cdef to:

then I wrote this function in the assetDataMain.c:

static void toggleGPIO()
{
bool active;
active = le_gpioPin21_Read();

if(active)
{
	LE_INFO("Pin is active, its gonna be deactivated");
	le_gpioPin21_Deactivate();
}

else

{
	LE_INFO("Pin is inactive, its gonna be activated");
	le_gpioPin21_Activate();
}

}

I couldn’t run the app, the log gives me:

info Legato: INFO | assetDataTutorial[16925]/componentAssetData T=main | assetDataMain.c _componentAssetData_COMPONENT_INIT() 212 | Legato AssetData: Start Legato AssetDataApp
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | LE_FILENAME le_mem_ForceAlloc() 841 | Memory pool ‘framework.SigMonitor’ overflowed. Expanded to 1 blocks.
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | LE_FILENAME le_mem_ForceAlloc() 841 | Memory pool ‘framework.SigHandler’ overflowed. Expanded to 1 blocks.
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | LE_FILENAME le_mem_ForceAlloc() 841 | Memory pool ‘.le_avc_ClientData’ overflowed. Expanded to 1 blocks.
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le_avc_client.c le_avc_AddStatusEventHandler() 618 | Sending message to server and waiting for response : 4 bytes sent
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le_avc_client.c le_avc_StartSession() 942 | Sending message to server and waiting for response : 0 bytes sent
info Legato: INFO | assetDataTutorial[16925]/componentAssetData T=main | assetDataMain.c _componentAssetData_COMPONENT_INIT() 227 | Legato AssetData: Started LWM2M session with AirVantage
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | LE_FILENAME le_timer_Start() 982 | threadRecPtr->timerFD=11
info Legato: INFO | assetDataTutorial[16925]/componentAssetData T=main | assetDataMain.c _componentAssetData_COMPONENT_INIT() 245 | Legato AssetData: Create 2 instances AssetData
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le_avdata_client.c le_avdata_Create() 756 | Sending message to server and waiting for response : 8 bytes sent
info Legato: INFO | avcDaemon[477]/avcDaemon T=main | assetData.c assetData_CreateInstanceByName() 3113 | Creating asset instance for assetDataTutorial/Room
info Legato: INFO | avcDaemon[477]/avcDaemon T=main | assetData.c assetData_CreateInstanceById() 2982 | Creating asset instance for assetDataTutorial/1000
info Legato: INFO | avcDaemon[477]/avcDaemon T=main | assetData.c assetData_CreateInstanceById() 3079 | Finished creating instance 0 for assetDataTutorial/1000
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le_avdata_client.c le_avdata_Create() 756 | Sending message to server and waiting for response : 8 bytes sent
info Legato: INFO | avcDaemon[477]/avcDaemon T=main | assetData.c assetData_CreateInstanceByName() 3113 | Creating asset instance for assetDataTutorial/Room
info Legato: INFO | avcDaemon[477]/avcDaemon T=main | assetData.c assetData_CreateInstanceById() 2982 | Creating asset instance for assetDataTutorial/1000
info Legato: INFO | avcDaemon[477]/avcDaemon T=main | assetData.c assetData_CreateInstanceById() 3079 | Finished creating instance 1 for assetDataTutorial/1000
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le_avdata_client.c le_avdata_SetString() 1376 | Sending message to server and waiting for response : 23 bytes sent
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le_avdata_client.c le_avdata_SetFloat() 1091 | Sending message to server and waiting for response : 27 bytes sent
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le_avdata_client.c le_avdata_SetBool() 1231 | Sending message to server and waiting for response : 16 bytes sent
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le_avdata_client.c le_avdata_SetInt() 951 | Sending message to server and waiting for response : 29 bytes sent
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | LE_FILENAME le_mem_ForceAlloc() 841 | Memory pool ‘.le_avdata_ClientData’ overflowed. Expanded to 1 blocks.
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le_avdata_client.c le_avdata_AddFieldEventHandler() 624 | Sending message to server and waiting for response : 29 bytes sent
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | LE_FILENAME le_mem_ForceAlloc() 841 | Memory pool ‘.le_avdata_ClientData’ overflowed. Expanded to 2 blocks.
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le_avdata_client.c le_avdata_AddFieldEventHandler() 624 | Sending message to server and waiting for response : 21 bytes sent
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le_avdata_client.c le_avdata_SetString() 1376 | Sending message to server and waiting for response : 27 bytes sent
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le_avdata_client.c le_avdata_SetFloat() 1091 | Sending message to server and waiting for response : 27 bytes sent
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le_avdata_client.c le_avdata_SetBool() 1231 | Sending message to server and waiting for response : 16 bytes sent
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le_avdata_client.c le_avdata_SetInt() 951 | Sending message to server and waiting for response : 29 bytes sent
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | LE_FILENAME le_mem_ForceAlloc() 841 | Memory pool ‘.le_avdata_ClientData’ overflowed. Expanded to 3 blocks.
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le_avdata_client.c le_avdata_AddFieldEventHandler() 624 | Sending message to server and waiting for response : 29 bytes sent
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | LE_FILENAME le_mem_ForceAlloc() 841 | Memory pool ‘.le_avdata_ClientData’ overflowed. Expanded to 4 blocks.
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | le_avdata_client.c le_avdata_AddFieldEventHandler() 624 | Sending message to server and waiting for response : 21 bytes sent
debug Legato: DBUG | assetDataTutorial[16925]/framework T=main | LE_FILENAME le_mem_ForceAlloc() 841 | Memory pool ‘framework.Default Timer Pool’ overflowed. Expanded to 2 blocks.
emerg Legato: EMR | assetDataTutorial[16925]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (assetDataTutorial.componentAssetData.le_gpioPin21:53b428577c18e3558699d57262acfc23).
info Legato: INFO | avcDaemon[477]/avcDaemon T=main | avData.c ClientCloseSessionHandler() 188 | Client 0x694ac closed, remove allocated resources
info Legato: INFO | avcDaemon[477]/avcDaemon T=main | assetData.c assetData_DeleteInstance() 3160 | Deleting instance assetDataTutorial/1000/1
info Legato: INFO | avcDaemon[477]/avcDaemon T=main | assetData.c assetData_DeleteInstance() 3160 | Deleting instance assetDataTutorial/1000/0
info Legato: INFO | supervisor[421]/supervisor T=main | proc.c proc_SigChildHandler() 1942 | Process ‘assetDataTutorial’ (PID: 16925) has exited with exit code 1.
info Legato: INFO | supervisor[421]/supervisor T=main | proc.c GetFaultAction() 1744 | No fault action specified for process ‘assetDataTutorial’. Assuming ‘ignore’.
info Legato: INFO | avcDaemon[477]/avcDaemon T=main | avcServer.c ClientCloseSessionHandler() 566 | Client 0x692b4 closed, remove allocated resources
warn Legato: -WRN- | supervisor[421]/supervisor T=main | app.c app_SigChildHandler() 3221 | Process ‘assetDataTutorial’ in app ‘assetDataTutorial’ faulted: Ignored.
warn Legato: -WRN- | _appStopClient[16926]/framework T=main | LE_FILENAME CreateSocket() 550 | Socket opened as standard i/o file descriptor 2!
info Legato: INFO | supervisor[421]/supervisor T=main | apps.c DeactivateAppContainer() 340 | Application ‘assetDataTutorial’ has stopped.
info Legato: INFO | updateDaemon[450]/updateDaemon T=main | updateDaemon.c updateDaemon_MarkGood() 203 | System passed probation. Marking ‘good’.

I don’t know much of communication between apps, I’m sure that’s where I’m getting it wrong.

Can anybody help me?

Regards