Skip to content

Commit b8270a5

Browse files
committed
include: Update SDK header files
* Add GPS Motion assistance support * Add API to get current network type * Add RIL event for network type change * Add support for custom name for tasks Signed-off-by: Ajay Bhargav <[email protected]>
1 parent 2c31eb7 commit b8270a5

File tree

5 files changed

+67
-3
lines changed

5 files changed

+67
-3
lines changed

include/gpslib.h

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,24 @@ enum gpsparam_e {
7979
GPS_PARAM_ODOMETER, /**< Set odometer value in meters */
8080
};
8181

82+
/**
83+
* GPS Motion assistance type
84+
*/
85+
enum gpsmatype_t {
86+
GPS_MOTIONASSIST_TYPE_NONE, /**< Motion assistance disabled */
87+
GPS_MOTIONASSIST_TYPE_IGNITION, /**< Motion assistance set to ignition */
88+
GPS_MOTIONASSIST_TYPE_MOTIONSENSE, /**< Motion assistance set to motion sensor */
89+
};
90+
91+
/**
92+
* GPS Motion assistance event generated from assistance source
93+
*/
94+
enum gpsmaevent_t {
95+
MOTIONASSIST_EVENT_IGN_ON, /**< Ignition on event */
96+
MOTIONASSIST_EVENT_IGN_OFF, /**< Ignition off event */
97+
MOTIONASSIST_EVENT_MOTION_DETECT, /**< Motion detected event */
98+
};
99+
82100
/**
83101
* GPS point structure
84102
*/
@@ -232,6 +250,23 @@ time_t gpsmktime(char *date_in, char *time_in);
232250
*/
233251
int geofence_check(int type, const struct point_t *fence, unsigned int corners_radius, const struct point_t *point);
234252

253+
/**
254+
* @brief Add motion detect assistance to GPS algorithm
255+
*
256+
* @param type Motion detect type @ref gpsmatype_t
257+
* @return return 0 on success
258+
*/
259+
int gps_motionassist_config(int type);
260+
261+
/**
262+
* @brief Inform GPS algorithm about event generated from assistance source
263+
* set using gps_motionassist_config()
264+
*
265+
* @param event Motion detect event @ref gpsmaevent_t
266+
* @return return 0 on success
267+
*/
268+
int gps_motionassist(int event);
269+
235270
#ifdef __cplusplus
236271
}
237272
#endif

include/network.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ enum _net_state {
2525
NET_STATE_SOC_SENDING /**< Network status sending data over socket */
2626
};
2727

28+
/**
29+
* @brief Network type
30+
*
31+
*/
32+
enum nettype_e {
33+
NET_TYPE_UNKNOWN,
34+
NET_TYPE_GSM,
35+
NET_TYPE_LTE,
36+
};
37+
2838
/**
2939
* Network parameter structure
3040
*/
@@ -134,6 +144,13 @@ unsigned char *network_getlocalip(void);
134144
*/
135145
const char *network_getcurrapn(void);
136146

147+
/**
148+
* Get current network type GSM/LTE
149+
*
150+
* @return network type value @ref nettype_e
151+
*/
152+
uint8_t network_gettype(void);
153+
137154
/**
138155
* Setup Network status LED. Attach GPIO line managed by network
139156
* thread for status LED.

include/os_api.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,23 +204,25 @@ uint32_t os_task_getid(void);
204204
/**
205205
* Create a new OS task, Maximum 10 tasks can be created
206206
* @param fn [in] Task function of type os_taskfn_f
207+
* @param name [in] Task name, cannot be NULL
207208
* @param arg [in] Argument to task function
208209
* @param suspend [in] TRUE will suspend the task on creation, FALSE otherwise. Suspended task can be started later by calling os_start_task()
209210
* @return On success task ID is returned, -1 on error.
210211
*/
211-
int os_task_create(os_taskfn_f fn, void *arg, int suspend);
212+
int os_task_create(os_taskfn_f fn, const char *name, void *arg, int suspend);
212213

213214
#if defined(SOC_RDA8910) || defined(PLATFORM_BC20) || defined(_DOXYGEN_)
214215
/**
215216
* Create a new OS task, with extended parameters
216217
* @note only available on NBIoT Platforms
217218
* @param fn [in] Task function of type os_taskfn_f
219+
* @param name [in] Task name, cannot be NULL
218220
* @param stack [in] Task stack size in bytes
219221
* @param arg [in] Argument to task function
220222
* @param suspend [in] TRUE will suspend the task on creation, FALSE otherwise. Suspended task can be started later by calling os_start_task()
221223
* @return On success task ID is returned, -1 on error.
222224
*/
223-
int os_task_create_ex(os_taskfn_f fn, uint32_t stack, void *arg, int suspend);
225+
int os_task_create_ex(os_taskfn_f fn, const char *name, uint32_t stack, void *arg, int suspend);
224226

225227
/**
226228
* Start a task created by @ref os_task_create() /@ref os_task_create_ex()

include/ril/ril.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@ enum networkstate_e {
5656
NW_STAT_SMSONLY_ROAMING, /**< 4G LTE Only: Registered for SMS only in Roaming network */
5757
};
5858

59+
/**
60+
* Network Mode value
61+
*/
62+
enum networkmode_e {
63+
NW_MODE_UNKNOWN, /**< Unknown mode */
64+
NW_MODE_GSM, /**< GSM Mode */
65+
NW_MODE_LTE, /**< LTE Mode */
66+
};
67+
5968
/**
6069
* Phone functionality state
6170
*/
@@ -106,6 +115,7 @@ enum sysurc_e {
106115
URC_ALARM_RING_IND, /**< Indication for clock alarm. */
107116
URC_STKPCI_RSP_IND, /**< Indication for un-handled STKPCI responses, Only when SIM Toolkit is enabled, Parameter value is incoming +STKPCI response as null terminated string */
108117
URC_RRC_STATUS_IND, /**< 4G LTE & NBIoT RRC Status update */
118+
URL_NW_MODE_CHANGE_IND, /**< Indication for change of network mode, only available on 4G LTE modules */
109119
URC_SYS_END = 100,
110120
/*
111121
* System URC definition end

include/storage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ int storage_init(const struct storagecfg_t *cfg);
6868
* @param len [in] Length of data in buffer
6969
* @return 0 on success, negative value on error
7070
*/
71-
int storage_save(int part, void *buffer, int len);
71+
int storage_save(int part, const void *buffer, int len);
7272

7373
/**
7474
* Read data from storage partition

0 commit comments

Comments
 (0)