gllbs_distr/gllbs_hal_os.h File Reference

Broadcom LBS API to OS. More...

#include "gllbs_types.h"
Include dependency graph for gllbs_hal_os.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  GlLbsOsCallbacks
 Structure for OS HAL callbacks. More...

Typedefs

typedef enum GLLBS_OS_LOG_SEVERITY GLLBS_OS_LOG_SEVERITY
 Generic HAL types.
typedef enum GLLBS_MODULE_MASK GLLBS_MODULE_MASK
 Module mask will enable debug information for specified module.
typedef void(* GlLbsOsLogVCb )(GLLBS_OS_LOG_SEVERITY sev, OSUINT32 mod_mask, const char *fmt, OSVALIST argptr)
 Log message.
typedef void(* GlLbsOsExceptionAssertCb )(const char *msg)
 Exception Assert.
typedef enum GLLBS_CONN_TYPE GLLBS_CONN_TYPE
 Connection type.
typedef void(* GlLbsOsConnectionRequestCb )(GLLBS_CONN_TYPE type, LBS_CONN_ID conn_id)
 Request connection.
typedef void(* GlLbsOsConnectionWriteCb )(OSCONN_HANDLE handle, const OSOCTET *data, OSUINT32 size)
 Send data buffer.
typedef void(* GlLbsOsConnectionCloseCb )(OSCONN_HANDLE handle)
 Close connection.
typedef enum GLLBS_FILE_ID GLLBS_FILE_ID
 Non-volatile storage.
typedef OSBOOL(* GlLbsOsNvsFileOpenCb )(GLLBS_FILE_ID file_id, OSUINT32 index, OSUINT8 open_mod)
 Open NV File and set current position to the beginning.
typedef void(* GlLbsOsNvsFileCloseCb )(GLLBS_FILE_ID file_id, OSUINT32 index)
 Close NV File.
typedef OSUINT32(* GlLbsOsNvsFileReadCb )(GLLBS_FILE_ID file_id, OSUINT32 index, OSOCTET *buf, OSUINT32 max_size)
 NV File read from current position and move the current position.
typedef OSUINT32(* GlLbsOsNvsFileWriteCb )(GLLBS_FILE_ID file_id, OSUINT32 index, const OSOCTET *buf, OSUINT32 size)
 NV File write to current position and move the current position.
typedef OSINT32(* GlLbsOsNvsFileSeekCb )(GLLBS_FILE_ID file_id, OSUINT32 index, OSINT32 offset, GLLBS_SEEK_WHENCE whence)
 NV File move current position to new position specified by offset and whence.
typedef OSUINT32(* GlLbsOsGetMsTimeCb )(void)
 Get Time.
typedef void *(* GlLbsOsMemAllocCb )(OSUINT32 size)
 Allocate memory.
typedef void(* GlLbsOsMemDeAllocCb )(void *ptr)
 Deallocate memory which was previously allocated by GlLbsOsMemAllocCb.
typedef OSTIMER_HANDLE(* GlLbsOsTimerCreateCb )(void)
 Create Timer.
typedef void(* GlLbsOsTimerDestroyCb )(OSTIMER_HANDLE handle)
 Destroy Timer.
typedef OSBOOL(* GlLbsOsTimerArmCb )(OSTIMER_HANDLE handle, OSUINT32 ms)
 Arm Timer.
typedef OSBOOL(* GlLbsOsTimerDisarmCb )(OSTIMER_HANDLE handle)
 Disarm Timer.
typedef void(* GlLbsOsHttpRequestCb )(const unsigned char *url, OSUINT32 maxSize, const OSOCTET *data, OSUINT32 size, GlLbsOsHttpResponseCb cb)
 Issue HTTP request.
typedef struct GlLbsOsCallbacks GlLbsOsCallbacks
 Structure for OS HAL callbacks.

Enumerations

enum  GLLBS_OS_LOG_SEVERITY { GLLBS_LOG_ERR, GLLBS_LOG_WARNING, GLLBS_LOG_INFO, GLLBS_LOG_DEBUG }
 Generic HAL types. More...
enum  GLLBS_MODULE_MASK
 Module mask will enable debug information for specified module.
enum  GLLBS_CONN_TYPE { GLLBS_CONN_LBS }
 Connection type. More...
enum  GLLBS_FILE_ID { ,
  GLLBS_FILE_LBS, GLLBS_FILE_NVS, GLLBS_FILE_NMR, GLLBS_FILE_WLAN,
  GLLBS_FILE_WNMR, GLLBS_FILE_IPS, GLLBS_FILE_COUNT
}
 Non-volatile storage. More...

Functions

void GlLbsOsConnected (LBS_CONN_ID conn_id, GLLBS_ERRORS result, OSCONN_HANDLE handle)
 Connection handling.
void GlLbsOsDisconnected (LBS_CONN_ID conn_id)
 Inform the LBS library after connection lost.
void GlLbsOsData (LBS_CONN_ID conn_id, OSOCTET *data, OSUINT32 size)
 Provide data received from connection to the LBS library.
void GlLbsOsTimeout (OSTIMER_HANDLE handle)
 Timer.

Detailed Description

Broadcom LBS API to OS.

Copyright (c) 2009 by Broadcom Corp. All Rights Reserved.

The information contained herein is confidential property of Broadcom. The use, copying, transfer or disclosure of such information is prohibited except by express written agreement with Broadcom.


Typedef Documentation

Generic HAL types.

Logging HAL Log severity

typedef void(* GlLbsOsConnectionCloseCb)(OSCONN_HANDLE handle)

Close connection.

Parameters:
handle- value provided in GlLbsOsConnected as "handle" This value can be used by HAL identify connection
typedef void(* GlLbsOsConnectionRequestCb)(GLLBS_CONN_TYPE type, LBS_CONN_ID conn_id)

Request connection.

Parameters:
type- Connection type
conn_id- This value used by the LBS library to identify connection request
typedef void(* GlLbsOsConnectionWriteCb)(OSCONN_HANDLE handle, const OSOCTET *data, OSUINT32 size)

Send data buffer.

Parameters:
handle- value provided in GlLbsOsConnected as "handle" This value can be used by HAL identify connection
data- address of buffer to send
size- length of the buffer
typedef void(* GlLbsOsExceptionAssertCb)(const char *msg)

Exception Assert.

Parameters:
file- file name like __FILE__
line- line number like __LINE__
msg- message.
typedef OSUINT32(* GlLbsOsGetMsTimeCb)(void)

Get Time.

Returns:
- monotonically increasing value scaled to milliseconds that may roll over (2^32 -> 0).
typedef void(* GlLbsOsHttpRequestCb)(const unsigned char *url, OSUINT32 maxSize, const OSOCTET *data, OSUINT32 size, GlLbsOsHttpResponseCb cb)

Issue HTTP request.

Parameters:
url- request URL
data- address of buffer to send
size- length of the buffer
typedef void(* GlLbsOsLogVCb)(GLLBS_OS_LOG_SEVERITY sev, OSUINT32 mod_mask, const char *fmt, OSVALIST argptr)

Log message.

Parameters:
sev- Log level.
mod_mask- specifies module(s) from GLLBS_MODULE_MASK
fmt- format and message (printf format)
argptr- format argument list (vprintf format)
typedef void*(* GlLbsOsMemAllocCb)(OSUINT32 size)

Allocate memory.

Parameters:
size- size of the requested memory to allocate.
Returns:
- pointer to the allocated memory. 0 - if memory can not be allocated
typedef void(* GlLbsOsMemDeAllocCb)(void *ptr)

Deallocate memory which was previously allocated by GlLbsOsMemAllocCb.

Parameters:
ptr- pointer to the memory which should be deallocated.
typedef void(* GlLbsOsNvsFileCloseCb)(GLLBS_FILE_ID file_id, OSUINT32 index)

Close NV File.

Parameters:
file_id- file type
typedef OSBOOL(* GlLbsOsNvsFileOpenCb)(GLLBS_FILE_ID file_id, OSUINT32 index, OSUINT8 open_mod)

Open NV File and set current position to the beginning.

Parameters:
file_id- file type
open_mod- open mode (see GLLBS_FILE_MODE)
Returns:
- TRUE when success
typedef OSUINT32(* GlLbsOsNvsFileReadCb)(GLLBS_FILE_ID file_id, OSUINT32 index, OSOCTET *buf, OSUINT32 max_size)

NV File read from current position and move the current position.

Parameters:
file_id- file type
buf- address of buffer to fill.
size- maximal size of the buffer.
Returns:
- number of read bytes
typedef OSINT32(* GlLbsOsNvsFileSeekCb)(GLLBS_FILE_ID file_id, OSUINT32 index, OSINT32 offset, GLLBS_SEEK_WHENCE whence)

NV File move current position to new position specified by offset and whence.

Parameters:
file_id- file type
index- file index for this file type
offset- offset into file related to whence definition
whence- SEEK_CUR, SEEK_SET, SEEK_END
Returns:
- number of bytes actually written
typedef OSUINT32(* GlLbsOsNvsFileWriteCb)(GLLBS_FILE_ID file_id, OSUINT32 index, const OSOCTET *buf, OSUINT32 size)

NV File write to current position and move the current position.

Parameters:
file_id- file type
buf- address of buffer to save.
size- length of the buffer.
Returns:
- number of bytes actually written
typedef OSBOOL(* GlLbsOsTimerArmCb)(OSTIMER_HANDLE handle, OSUINT32 ms)

Arm Timer.

Parameters:
handle- value returned by GlLbsOsTimerCreateCb as "handle"
ms- interval in milliseconds
Returns:
- TRUE on success
typedef OSTIMER_HANDLE(* GlLbsOsTimerCreateCb)(void)

Create Timer.

Returns:
- timer handle if creation was successful, null otherwise.
typedef void(* GlLbsOsTimerDestroyCb)(OSTIMER_HANDLE handle)

Destroy Timer.

Parameters:
handle- value returned by GlLbsOsTimerCreateCb as "handle" This value can be used by HAL to identify timer
typedef OSBOOL(* GlLbsOsTimerDisarmCb)(OSTIMER_HANDLE handle)

Disarm Timer.

Parameters:
handle- value returned by GlLbsOsTimerCreateCb as "handle"
Returns:
- TRUE on success

Enumeration Type Documentation

Connection type.

Enumerator:
GLLBS_CONN_LBS 

Connection to the LBS server.

Non-volatile storage.

Enumerator:
GLLBS_FILE_LBS 

LTO File.

GLLBS_FILE_NVS 

File to store LBS local database.

GLLBS_FILE_NMR 

Store Broadcom GLL specific information.

GLLBS_FILE_WLAN 

File to store information for NMR/MRL positioning.

GLLBS_FILE_WNMR 

WLAN local database.

GLLBS_FILE_IPS 

WLAN downloaded file.

GLLBS_FILE_COUNT 

IPS local database.

Max file number

Generic HAL types.

Logging HAL Log severity

Enumerator:
GLLBS_LOG_ERR 

error conditions

GLLBS_LOG_WARNING 

warning conditions

GLLBS_LOG_INFO 

information message

GLLBS_LOG_DEBUG 

debug-level messages


Function Documentation

void GlLbsOsConnected ( LBS_CONN_ID  conn_id,
GLLBS_ERRORS  result,
OSCONN_HANDLE  handle 
)

Connection handling.

Report status of connection request initiated by GlLbsOsConnectionRequestCb

Parameters:
conn_id- value provided by GlLbsOsConnectionRequestCb as "conn_id" argument This value used by the LBS library to identify connection request
result- error code
handle- This value will be provided by the LBS library as "handle" parameter in GlLbsOsConnectionWriteCb and GlLbsOsConnectionCloseCb functions
void GlLbsOsData ( LBS_CONN_ID  conn_id,
OSOCTET *  data,
OSUINT32  size 
)

Provide data received from connection to the LBS library.

Parameters:
conn_id- value provided by GlLbsOsConnectionRequestCb as "conn_id" argument This value used by the LBS library to identify connection request
data- address of buffer
size- length of the buffer
void GlLbsOsDisconnected ( LBS_CONN_ID  conn_id)

Inform the LBS library after connection lost.

Parameters:
conn_id- value provided by GlLbsOsConnectionRequestCb as "conn_id" argument This value used by the LBS library to identify connection request
void GlLbsOsTimeout ( OSTIMER_HANDLE  handle)

Timer.

Inform the LBS library when timeout occurred

Parameters:
handle- value provided by GlLbsOsTimerArmCb as "handle" argument
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines