framework/doc/swi_airvantage.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002  * Copyright (c) 2014 Sierra Wireless and others.
00003  * All rights reserved. This program and the accompanying materials
00004  * are made available under the terms of the Eclipse Public License v1.0
00005  * which accompanies this distribution, and is available at
00006  * http://www.eclipse.org/legal/epl-v10.html
00007  *
00008  * Contributors:
00009  *     Laurent Barthelemy for Sierra Wireless - initial API and implementation
00010  *     Romain Perier      for Sierra Wireless - initial API and implementation
00011  *******************************************************************************/
00012 
00013 
00035 #ifndef SWI_AIRVANTAGE_INCLUDE_GUARD
00036 #define SWI_AIRVANTAGE_INCLUDE_GUARD
00037 
00038 #include <stdlib.h>
00039 #include "returncodes.h"
00040 #include "swi_dset.h"
00041 
00053 #define SWI_AV_ERROR 1
00054 #define SWI_AV_INFO 1
00055 
00063 rc_ReturnCode_t swi_av_Init();
00064 
00070 rc_ReturnCode_t swi_av_Destroy();
00071 
00072 
00073 #define SWI_AV_CX_SYNC UINT_MAX ///< Value to be used to request synchronous connection to server using #swi_av_ConnectToServer
00074 
00090 rc_ReturnCode_t swi_av_ConnectToServer
00091 (
00092     unsigned int latency 
00093 
00094 );
00095 
00096 
00097 
00115 rc_ReturnCode_t swi_av_TriggerPolicy
00116 (
00117     const char* policyPtr 
00118 
00119 );
00120 
00121 
00127 typedef struct swi_av_Asset swi_av_Asset_t;
00128 
00129 
00144 rc_ReturnCode_t swi_av_asset_Create
00145 (
00146     swi_av_Asset_t** asset, 
00147 
00148 
00149     const char* assetIdPtr  
00150 
00151 
00152 );
00153 
00154 
00155 
00156 
00157 
00158 
00166 rc_ReturnCode_t swi_av_asset_Start
00167 (
00168     swi_av_Asset_t* asset 
00169 );
00170 
00171 
00180 rc_ReturnCode_t swi_av_asset_Destroy
00181 (
00182     swi_av_Asset_t* asset 
00183 );
00184 
00185 
00186 // end General
00188 
00201 typedef enum swi_av_timestamp{
00202   SWI_AV_TSTAMP_NO = 0,   
00203   SWI_AV_TSTAMP_AUTO = 1, 
00204 }swi_av_timestamp_t;
00205 
00220 rc_ReturnCode_t swi_av_asset_PushString
00221 (
00222     swi_av_Asset_t* asset, 
00223     const char *pathPtr,   
00224 
00225 
00226     const char* policyPtr, 
00227 
00228     uint32_t timestamp,    
00229 
00230     const char* valuePtr   
00231 );
00232 
00247 rc_ReturnCode_t swi_av_asset_PushInteger
00248 (
00249     swi_av_Asset_t* asset, 
00250     const char *pathPtr,   
00251 
00252     const char* policyPtr, 
00253 
00254     uint32_t timestamp,    
00255 
00256     int64_t value          
00257 );
00258 
00273 rc_ReturnCode_t swi_av_asset_PushFloat
00274 (
00275     swi_av_Asset_t* asset, 
00276     const char *pathPtr,   
00277 
00278     const char* policyPtr, 
00279 
00280     uint32_t timestamp,    
00281 
00282     double value           
00283 );
00284 
00285 // end Data Sending Simple API
00287 
00298 typedef struct swi_av_Table swi_av_Table_t;
00299 
00303 typedef enum
00304 {
00305   STORAGE_RAM = 0, 
00306   STORAGE_FLASH    
00307 } swi_av_Table_Storage_t;
00308 
00319 rc_ReturnCode_t swi_av_table_Create
00320 (
00321     swi_av_Asset_t* asset,      
00322     swi_av_Table_t** table,     
00323 
00324 
00325     const char* pathPtr,        
00326     size_t numColumns,          
00327     const char** columnNamesPtr,
00328     const char* policyPtr,      
00329     swi_av_Table_Storage_t persisted, 
00330 
00331     int purge                   
00332 
00333 
00334 );
00335 
00336 
00345 rc_ReturnCode_t swi_av_table_Destroy
00346 (
00347     swi_av_Table_t* table 
00348 );
00349 
00350 
00360 rc_ReturnCode_t swi_av_table_PushFloat
00361 (
00362     swi_av_Table_t* table, 
00363     double value           
00364 );
00365 
00366 
00367 
00377 rc_ReturnCode_t swi_av_table_PushInteger
00378 (
00379     swi_av_Table_t* table, 
00380     int value              
00381 );
00382 
00392 rc_ReturnCode_t swi_av_table_PushString
00393 (
00394     swi_av_Table_t* table, 
00395     const char* value      
00396 );
00397 
00398 
00409 rc_ReturnCode_t swi_av_table_PushRow
00410 (
00411     swi_av_Table_t* table 
00412 );
00413 
00414 
00415 
00416 // end Data Sending Advanced API
00418 
00441 typedef void (*swi_av_DataWriteCB)
00442 (
00443     swi_av_Asset_t *asset,        
00444     const char *pathPtr,          
00445     swi_dset_Iterator_t* data,    
00446 
00447     int ack_id,                   
00448 
00449     void *userDataPtr             
00450 );
00451 
00452 
00453 
00491 rc_ReturnCode_t swi_av_RegisterDataWrite
00492 (
00493     swi_av_Asset_t *asset, 
00494     swi_av_DataWriteCB cb, 
00495     void * userDataPtr     
00496 );
00497 
00498 
00507 rc_ReturnCode_t swi_av_Acknowledge
00508 (
00509     int ackId,             
00510     int status,            
00511     const char* errMsgPtr, 
00512     const char* policyPtr, 
00513     int persisted          
00514 
00515 );
00516 
00517 
00518 
00519 
00520 // end Data Reception
00522 
00560 typedef rc_ReturnCode_t (*swi_av_updateNotificationCB)
00561 (
00562     swi_av_Asset_t *asset,               
00563     const char* componentNamePtr,        
00564 
00565     const char* versionPtr,              
00566 
00567     const char *updateFilePathPtr,       
00568 
00569 
00570     swi_dset_Iterator_t* customParams,   
00571 
00572     void *userDataPtr                    
00573 );
00574 
00575 
00603 rc_ReturnCode_t swi_av_RegisterUpdateNotification
00604 (
00605     swi_av_Asset_t* asset,           
00606     swi_av_updateNotificationCB cb,  
00607 
00608     void *userDataPtr                
00609 );
00610 
00611 
00618 rc_ReturnCode_t swi_av_SendUpdateResult
00619 (
00620     swi_av_Asset_t* asset,        
00621     const char* componentNamePtr, 
00622 
00623 
00624     int updateResult              
00625 
00626 
00627 );
00628 
00629 
00630 // end Asset Update
00632 
00633 #endif /* SWI_AIRVANTAGE_INCLUDE_GUARD */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines