123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491 |
- #ifndef __OEM_LIB__
- #define __OEM_LIB__
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include <stdlib.h>
- #include <string.h>
- #include <stdio.h>
- #ifdef POSIX
- #include <semaphore.h>
- #endif
- /*oem lib extern functions*/
- extern void lib_oem_tts_play_end_cb();
- extern void lib_oem_player_need_data_len_cb(int datalen);
- extern void lib_oem_record_cb(const char* data, int length);
- /*tts functions*/
- /*
- * Function: lib_oem_tts_play
- *
- * Description:
- * push the tts data
- *
- * Rarameter:
- * text:unicode data
- *
- * Return:
- * none
- */
- int lib_oem_tts_play(char *text);
- /*
- * Function: lib_oem_tts_stop
- *
- * Description:
- * stop the tts
- *
- * Rarameter:
- * none
- *
- * Return:
- * none
- */
- int lib_oem_tts_stop(void);
- /*
- * Function: lib_oem_tts_status
- *
- * Description:
- * get the tts status
- *
- * Rarameter:
- * none
- *
- * Return:
- * 0-not work
- * 1-working
- */
- int lib_oem_tts_status(void);
- /*
- * Function: lib_oem_start_record
- *
- * Description:
- * start record for ptt or open device for record
- *
- * Rarameter:
- * none
- *
- * Return:
- * none
- */
- int lib_oem_start_record(void);
- /*
- * Function: lib_oem_stop_record
- *
- * Description:
- * stop record or close device for record
- *
- * Rarameter:
- * none
- *
- * Return:
- * none
- */
- int lib_oem_stop_record(void);
- /*
- * Function: lib_oem_start_play
- *
- * Description:
- * start play pcm, or open device for play
- *
- * Rarameter:
- * none
- *
- * Return:
- * none
- */
- int lib_oem_start_play(void);
- /*
- * Function: lib_oem_stop_play
- *
- * Description:
- * stop play pcm, or close device for play
- *
- * Rarameter:
- * none
- *
- * Return:
- * none
- */
- int lib_oem_stop_play(void);
- /*
- * Function: lib_oem_play
- *
- * Description:
- * push pcm data
- *
- * Rarameter:
- * data:pcm data
- * length: the length of data
- *
- * Return:
- * receive data length
- */
- int lib_oem_play(const char* data, int length);
- /*
- * Function: lib_oem_out_space
- *
- * Description:
- * pcm free space
- *
- * Rarameter:
- * none
- *
- * Return:
- * > 0 free
- * 0 busy
- */
- int lib_oem_out_space(void);
- /*
- * Function: lib_oem_play_tone
- *
- * Description:
- * Play tone
- *
- * Rarameter:
- * type:
- * [0]--start ptt
- * [1]--stop ptt
- * [2]--error
- * [3]--start play
- * [4]--stop play
- *
- * Return:
- * none
- */
- int lib_oem_play_tone(int type);
- /*voice call functions */
- int lib_oem_setup_call(char* dial_number);
- int lib_oem_call_state();
- int lib_oem_call_state_change_notify();
- int lib_oem_call_hungup();
- /* network functions*/
- /*
- * Function: lib_oem_socket_set_apn
- *
- * Description:
- * set the new apn
- *
- * Rarameter:
- * apn
- *
- * Return:
- * none
- */
- void lib_oem_socket_set_apn(char *apn);
- /*
- * Function: lib_oem_socket_net_open
- *
- * Description:
- * Open the network data
- *
- * Rarameter:
- * none
- *
- * Return:
- * 0-FAIL
- * 1-SUCCESS
- */
- int lib_oem_socket_net_open(void);
- /*
- * Function: lib_oem_socket_get_net_status
- *
- * Description:
- * Get network data status
- *
- * Parameter:
- * none
- *
- * Return:
- * 0-FAIL
- * 1-SUCCESS
- */
- int lib_oem_socket_get_net_status(void);
- /*
- * Function: lib_oem_socket_get_network
- *
- * Description:
- * Get network status
- *
- * Rarameter:
- * none
- *
- * Return:
- * -1-FAIL
- * 0-
- * 1-SUCCESS
- */
- int lib_oem_socket_get_network(void);
- /*
- * Function: lib_oem_get_rssi
- *
- * Description:
- * Get network signal strength
- *
- * Rarameter:
- * none
- *
- * Return:
- * rssi
- *
- */
- int lib_oem_get_rssi(void);
- /*
- * Function: lib_oem_net_close
- *
- * Description:
- * Close the network
- *
- * Rarameter:
- * none
- *
- * Return:
- * 0-SUCCESS
- * 1-FAILURE
- *
- */
- int lib_oem_net_close(void);
- /*
- * Function: lib_oem_reset_ps
- *
- * Description:
- * network module restart
- *
- * Rarameter:
- * none
- *
- * Return:
- * 0-SUCCESS
- * 1-FAILURE
- *
- */
- int lib_oem_reset_ps(void);
- /*module init*/
- /*
- * Function: lib_oem_module_init
- *
- * Description:
- * Initialize mcm cilent for network, sim,sms,etc
- *
- * Rarameter:
- * none
- *
- * Return:
- * 0-FAILURE
- * 1-SUCCESS
- *
- */
- int lib_oem_module_init(void);
- /*
- * Function: lib_oem_play_open_pcm
- *
- * Description:
- * Initialize pcm for TTS
- *
- * Input:
- * none
- *
- * Return:
- * 0-FAILURE
- * 1-SUCCESS
- *
- */
- int lib_oem_play_open_pcm();
- /*sim*/
- /*
- * Function: lib_oem_is_sim_present
- *
- * Description:
- * Check the status of the SIM card
- *
- * Input:
- * none
- *
- * Return:
- * 0-SIMcard is absent
- * 1-SIM card is present
- *
- */
- int lib_oem_is_sim_present(void);
- /*========================================================================================
- FUNCTION:
- lib_oem_get_device_serial_number
- DESCRIPTION:
- get imei and meid
- PARAMETERS:
- data:imei+0x0a+meid+0x0a+0x00
- RETURN:
- [0]SUCCESS
- [-1]FAILURE
- =========================================================================================*/
- int lib_oem_get_device_serial_number(char* data);
- /*========================================================================================
- FUNCTION:
- lib_oem_get_sim_serial_number
- DESCRIPTION:
- get iccid and imsi
- PARAMETERS:
- data:iccid+0x0a+imsi+0x0a+0x00
- RETURN:
- [0]SUCCESS
- [-1]FAILURE
- =========================================================================================*/
- int lib_oem_get_sim_serial_number(char* data);
- /*========================================================================================
- FUNCTION:
- lib_oem_get_model
- DESCRIPTION:
- get model name
- RETURN:
- name
- =========================================================================================*/
- char* lib_oem_get_model(void);
- /*========================================================================================
- FUNCTION:
- lib_oem_get_system_version
- DESCRIPTION:
- get system version
- RETURN:
- version
- =========================================================================================*/
- char* lib_oem_get_system_version(void);
- /*========================================================================================
- FUNCTION:
- lib_oem_send_uart
- DESCRIPTION:
- poc uart sent at
- PARAMETERS:
- data:AT size: AT len
- RETURN:
- [0]SUCCESS
- [-1]FAILURE
- =========================================================================================*/
- int lib_oem_send_uart(const char* data, int size);
- /*========================================================================================
- FUNCTION:
- lib_oem_uart_cb
- DESCRIPTION:
- poc uart recv at
- PARAMETERS:
- data:AT size: AT len
- RETURN:
- [0]SUCCESS
- [-1]FAILURE
- =========================================================================================*/
- extern int lib_oem_uart_cb(char* data, int size);
- /*========================================================================================
- FUNCTION:
- poc_uart_open
- DESCRIPTION:
- poc open uart
- =========================================================================================*/
- void poc_uart_open(void);
- /*========================================================================================
- FUNCTION:
- poc_uart_close
- DESCRIPTION:
- poc close uart
- =========================================================================================*/
- void poc_uart_close(void);
- /**远程升级初始化
- *@return 0: 表示成功
- * <0: 表示失败
- **/
- int lib_oem_ota_init(void);
- /**远程升级下载
- *@param data: 下载固件包数据
- *@param len: 下载固件包长度
- *@param total: 固件包总大小
- *@return 0: 表示成功
- * <0: 表示失败
- **/
- int lib_oem_ota_process(char* data, unsigned int len, unsigned int total);
- /**远程升级结束且校验
- *@return 0: 表示成功, 成功后模块自动重启升级
- * <0: 表示失败
- **/
- int lib_oem_ota_done(void);
- extern int lib_oem_device_bts(int* mcc,int* mnc,int* lac, int* cid);
- #ifdef __cplusplus
- }
- #endif
- #endif
|