Add T106 header file.
Change-Id: I139abf126f194dc011d5cdf531722152f90a1e90
diff --git a/mbtk/lynq_lib/src/lynq_adc.c b/mbtk/lynq_lib/src/lynq_adc.c
new file mode 100755
index 0000000..ae40db6
--- /dev/null
+++ b/mbtk/lynq_lib/src/lynq_adc.c
@@ -0,0 +1,25 @@
+#include "lynq-adc.h"
+#include "mbtk_type.h"
+#include "mbtk_adc.h"
+#include "mbtk_log.h"
+
+int qser_adc_show(ADC_CHANNEL_E qadc)
+{
+ UNUSED(qadc);
+
+ mbtk_adc_enum adc = MBTK_ADC0;
+ switch(qadc) {
+ case ADC0:
+ adc = MBTK_ADC0;
+ break;
+ case ADC1:
+ adc = MBTK_ADC1;
+ break;
+ default:
+ LOGE("Unsupport adc : %d", qadc);
+ return -1;
+ }
+
+ return mbtk_adc_get(adc);
+}
+
diff --git a/mbtk/lynq_lib/src/lynq_alarm.c b/mbtk/lynq_lib/src/lynq_alarm.c
new file mode 100755
index 0000000..2419ac0
--- /dev/null
+++ b/mbtk/lynq_lib/src/lynq_alarm.c
@@ -0,0 +1,35 @@
+#include "mbtk_alarm.h"
+#include "lynq_alarm.h"
+
+int lynq_set_wakealarm(unsigned long time_sec)
+{
+ UNUSED(time_sec);
+
+ return 0;
+}
+
+int lynq_set_poweralarm(unsigned long time_sec)
+{
+ UNUSED(time_sec);
+
+ return 0;
+}
+
+ssize_t wakealarm(char *buffer)
+{
+ UNUSED(buffer);
+
+ return 0;
+}
+
+ssize_t poweralarm(char *buffer)
+{
+ UNUSED(buffer);
+
+ return 0;
+}
+
+int cancel_wakealarm(void)
+{
+ return 0;
+}
\ No newline at end of file
diff --git a/mbtk/lynq_lib/src/lynq_audio.c b/mbtk/lynq_lib/src/lynq_audio.c
index f783f5f..7cdb9be 100755
--- a/mbtk/lynq_lib/src/lynq_audio.c
+++ b/mbtk/lynq_lib/src/lynq_audio.c
@@ -1,363 +1,97 @@
-/**
- * \file lynq_audio_api.c
- * \brief A Documented file.
- *
- * Detailed description
- * \Author: luojian
- * \Version: 1.0.0
- * \Date: 2022-10-27
- */
-#include <fcntl.h>
-#include <stdint.h>
-#include <limits.h>
-#include <termios.h>
-#include <stdarg.h>
-#include <dirent.h>
-#include <sys/stat.h>
-#include <sys/statfs.h>
-#include <sys/types.h>
-#include <string.h>
-#include <unistd.h>
-#include <pthread.h>
-#include <time.h>
-#include <sys/ioctl.h>
-#include <stdio.h>
-#include <signal.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <pthread.h>
-
-#include "mbtk_log.h"
+#include "lynq-qser-audio.h"
#include "mbtk_type.h"
+#include "mbtk_log.h"
-#ifdef MBTK_PLATFORM_ASR1803
-
-#include "mbtk_audio.h"
-
-static int rec_fd = 0;
-static int play_fd = 0;
-static mbtk_audio_handle play_hdl = NULL;
-static mbtk_audio_handle record_hdl = NULL;
-int volume_size = 0;
-pthread_t paly_thread;
-
-
-void dtmf_cb(char dtmf)
+int qser_AudPlayer_Open(char* device, _cb_onPlayer cb_fun)
{
- printf("%s:%c\n", __FUNCTION__, dtmf);
-}
-
-void audio_volume_cb(int volume)
-{
- volume_size = volume;
- printf("%s:%d\n", __FUNCTION__, volume);
-}
-
-int lynq_memscpy
-(
- void *dst,
- int dst_size,
- const void *src,
- int src_size
-)
-{
- if(dst_size == 0 || src_size == 0 || dst == NULL || src == NULL)
- {
- return 0;
- }
- else
- {
- return memcpy( dst, src,src_size);
- }
-} /* dsatutil_free_memory() */
-
-static int lynq_get_path_name ( const char* path_name,char* path )
-{
- int i=0;
- int last = -1;
- int len = strlen ( path_name );
- if ( len > 0 )
- {
- for ( i=len - 1; i >= 0; i-- )
- {
- if ( path_name[i] == '/' )
- {
- last = i;
- break;
- }
- }
- if ( i != -1 )
- {
- lynq_memscpy ( path, ( i + 1 ) * sizeof ( char ), path_name, ( i + 1 ) * sizeof ( char ) );
- printf ( "mbtk_get_path %s", path );
- return 0;
- }
- }
- return -1;
-}
-
-int lynq_create_audio_dir(const char *dirname)
-{
- DIR *p_dir;
- int res = -1, i = 0;;
- char str[512];
- strncpy(str, dirname, 512);
- int len=strlen(str);
-
- if(NULL == (p_dir = opendir((const char *)dirname)))
- {
- for(i=0; i<len; i++ )
- {
- if( str[i]=='/' )
- {
- str[i] = '\0';
- if( access(str,0)!=0 )
- {
- if(mkdir(dirname, 0777) == 0)
- {
- res = 0;
- }
- else
- {
- fprintf(stderr, "create audio dir error \n");
- res = -1;
- }
- }
- str[i]='/';
- }
- }
- if( len>0 && access(str,0)!=0 )
- {
- if(mkdir(dirname, 0777) == 0)
- {
- res = 0;
- }
- else
- {
- fprintf(stderr, "create audio dir error \n");
- res = -1;
- }
- }
- }
- else
- {
- closedir(p_dir);
- res = 0;
- }
- return res;
-}
-
-void lynq_record_cb_func(int cb_result, char* databuf, unsigned int len)
-{
- int rc;
- // printf("lynq_record_cb_func() len:%d, rec_fd:%d\n", len, rec_fd);
- if(NULL == databuf)
- {
- printf("NULL == databuf\n");
- }
-
- if(NULL != databuf && len > 0 && rec_fd > 0)
- {
- //for debug:save into file
- rc = write(rec_fd, databuf, len);
- if (rc < 0) {
- printf("%s: error writing to file!\n", __FUNCTION__);
- } else if (rc < len) {
- printf("%s: wrote less the buffer size!\n", __FUNCTION__);
- }
- }
-}
-#else
-
-#endif
-
-int lynq_media_rec_audio(const char *path)
-{
-#ifdef MBTK_PLATFORM_ASR1803
- int ret = 0;
- char audio_dir[50] ={0};
- char audio_wav[10] = {0};
- lynq_get_path_name(path, audio_dir);
- printf("path:%s, audio_dir:%s\n", path, audio_dir);
-
- record_hdl = mbtk_audio_open(MBTK_AUTIO_TYPE_IN, 1, 8000, NULL);
- if (record_hdl == 0)
- {
- printf("AudRecorder open error\n");
- return -1;
- }
-
- lynq_create_audio_dir(audio_dir);
- rec_fd = open(path, O_RDWR|O_CREAT|O_TRUNC, 0644);
- if (rec_fd <= 0)
- {
- printf("file open error\n");
- goto err;
- }
-
- if(-1 == mbtk_audio_record(record_hdl, lynq_record_cb_func, NULL))
- {
- printf("file write error\n");
- goto err;
- }
+ UNUSED(device);
+ UNUSED(cb_fun);
return 0;
-// sleep(10);
-err:
-// Ql_AudRecorder_Close();
- if(rec_fd > 0)
- {
- close(rec_fd);
- rec_fd = 0;
- }
-
- return -1;
-#else
-
- return -1;
-#endif
}
-
-
-//停止录制音频文件
-void lynq_media_rec_stop_audio(void)
+int qser_AudPlayer_PlayFrmFile(int hdl, const char *fd, int offset)
{
-#ifdef MBTK_PLATFORM_ASR1803
-// sleep(10);
- mbtk_audio_close(record_hdl);
- if(rec_fd > 0)
- {
- close(rec_fd);
- rec_fd = 0;
- }
-#else
-
-#endif
-}
-
-#ifdef MBTK_PLATFORM_ASR1803
-//播放音频文件
-int lynq_media_play_audio_thread_handle(void *argv)
-{
- char databuf[1024];
- int size;
-
- char *path = (char *)argv;
- printf("lynq_media_play_audio() start \npath:%s\n",path);
- LOGI("%s %d", __FUNCTION__, __LINE__);
- play_hdl = mbtk_audio_open(MBTK_AUTIO_TYPE_OUT, 1, 8000, NULL);
- if(NULL == play_hdl)
- printf("mbtk_audio_open fail\n");
-
- play_fd = open(path, O_RDWR);
- if (play_fd <= 0)
- {
- printf("file open error\n");
- goto err;
- }
- memset(databuf, 0, sizeof(databuf));
- while(0 < (size = read(play_fd, databuf, sizeof(databuf))))
- {
- if(-1 == mbtk_audio_play_stream(play_hdl, databuf, size))
- break;
- }
- printf("aplay Stream end \n");
-
-err:
- if(play_fd > 0)
- {
- close(play_fd);
- play_fd = 0;
- }
-
- pthread_exit(&paly_thread);
- mbtk_audio_close(play_hdl);
- return 0;
-}
-#endif
-
-//创建线程播放音频文件
-int lynq_media_play_audio(const char *path)
-{
-#ifdef MBTK_PLATFORM_ASR1803
- int ret = pthread_create(&paly_thread, NULL, lynq_media_play_audio_thread_handle, (void *)path);
- if (ret != 0) {
- printf("create thread failed!\n");
- return -1;
- }
-
- pthread_detach(paly_thread);
- return 0;
-#else
+ UNUSED(hdl);
+ UNUSED(fd);
+ UNUSED(offset);
return 0;
-#endif
}
-
-//停止播放音频文件
-void lynq_media_stop_audio(void)
+int qser_AudPlayer_Pause(int hdl)
{
-#ifdef MBTK_PLATFORM_ASR1803
- printf("lynq_media_stop_audio()----\n");
- if(play_fd > 0)
- {
- int ret = pthread_cancel(paly_thread);
- if (ret != 0) {
- printf("cancle paly_thread fail\n");
- return ;
- }
- close(play_fd);
- play_fd = 0;
- }
- mbtk_audio_close(play_hdl);
-#else
+ UNUSED(hdl);
-#endif
-}
-
-#ifdef MBTK_PLATFORM_ASR1803
-int lynq_audio_ubus_client_init(mbtk_audio_client_handle_type *ph_audio, mbtk_dtmf_cb cb)
-{
- if(rec_fd > 0 || play_fd > 0)
- {
- printf("rec or play need close\n");
- return -1;
- }
- return mbtk_audio_ubus_client_init(ph_audio, cb);
-}
-
-int lynq_audio_ubus_client_deinit(mbtk_audio_client_handle_type h_audio)
-{
- if(rec_fd > 0 || play_fd > 0)
- {
- printf("rec or play need close\n");
- return -1;
- }
- return mbtk_audio_ubus_client_deinit(h_audio);
-}
-#endif
-
-int lynq_get_spk_volume(int * volume)
-{
-#ifdef MBTK_PLATFORM_ASR1803
- mbtk_audio_ubus_volume_get(audio_volume_cb);
- *volume = volume_size;
- return 0;
-#else
return 0;
-#endif
+}
+
+int qser_AudPlayer_Resume(int hdl)
+{
+ UNUSED(hdl);
+
+ return 0;
+}
+
+void qser_AudPlayer_Stop(int hdl)
+{
+ UNUSED(hdl);
+
+ return 0;
}
-int lynq_set_spk_volume(const int volume)
+void qser_AudPlayer_Close(int hdl)
{
-#ifdef MBTK_PLATFORM_ASR1803
- mbtk_audio_ubus_volume_set(volume);
+ UNUSED(hdl);
+
return 0;
-#else
+}
+
+
+int qser_AudRecorder_Open(char* device, _cb_onPlayer cb_fun)
+{
+ UNUSED(device);
+ UNUSED(cb_fun);
+
+
return 0;
-#endif
+}
+
+int qser_AudRecorder_StartRecord(int hdl, const char *fd, int offset)
+{
+ UNUSED(hdl);
+ UNUSED(fd);
+ UNUSED(offset);
+
+
+ return 0;
+}
+
+int qser_AudRecorder_Pause(void)
+{
+
+ return 0;
+}
+
+int qser_AudRecorder_Resume(void)
+{
+
+ return 0;
+}
+
+void qser_AudRecorder_Stop(void)
+{
+
+}
+
+void qser_AudRecorder_Close(void)
+{
+
+}
+
+void qser_Audio_Deinit(void)
+{
+
}
diff --git a/mbtk/lynq_lib/src/lynq_call_api.c b/mbtk/lynq_lib/src/lynq_call_api.c
deleted file mode 100755
index ccab09f..0000000
--- a/mbtk/lynq_lib/src/lynq_call_api.c
+++ /dev/null
@@ -1,458 +0,0 @@
-#include "lynq/lynq_call_api.h"
-#include "mbtk_info_api.h"
-
-static mbtk_info_handle_t* info_handle = NULL;
-int lynq_volume_size = 0;
-#ifdef MBTK_PLATFORM_ASR1803
-mbtk_audio_client_handle_type lynq_dtmf_handle;
-#endif
-mbtk_call_info_t lynq_reg[5]={0};
-int *handle_ptr=null;
-void (*incoming_call_cb_p)(int x)=NULL;
-void lynq_call_state_change_cb(const void* data, int data_len)
-{
- mbtk_call_info_t *reg = (mbtk_call_info_t *)data;
- switch (reg->call_wait)
- {
- case MBTK_CLCC:
- {
- lynq_reg[reg->dir1].dir1 = reg->dir1;
- lynq_reg[reg->dir1].dir = reg->dir;
- lynq_reg[reg->dir1].state = reg->state;
- lynq_reg[reg->dir1].mode = reg->mode;
- lynq_reg[reg->dir1].mpty = reg->mpty;
- memset(lynq_reg[reg->dir1].phone_number,0,strlen(reg->phone_number));
- memcpy(lynq_reg[reg->dir1].phone_number,reg->phone_number,strlen(reg->phone_number));
- lynq_reg[reg->dir1].type = reg->type;
- printf("\r\nRING : %d, %d, %d, %d, %d, %s, %d, %d\r\n", reg->dir1, reg->dir, reg->state, reg->mode, reg->mpty, reg->phone_number, reg->type,strlen(reg->phone_number));
- if(handle_ptr != null)
- {
- if(*handle_ptr != reg->dir1)
- {
- *handle_ptr = reg->dir1;
- printf("reg->dir1 : %d\r\n handle=%d\n", reg->dir1,*handle_ptr);
- handle_ptr = NULL;
- }
- }
- if(reg->dir == 1)
- (*incoming_call_cb_p)(reg->dir1);
- break;
- }
- case MBTK_DISCONNECTED:
- memset(&(lynq_reg[reg->disconnected_id]),0,sizeof(lynq_reg[reg->disconnected_id]));
- printf("\r\nRING : call dis connected: %d!\r\n", reg->disconnected_id);
- printf("phone number : %s",lynq_reg[reg->disconnected_id].phone_number);
- lynq_set_mute_mic(0);
- break;
- case MBTK_CPAS:
- printf("\r\nCALL : Call state = %d\r\n", reg->pas);
- /*
- MBTK_CALL_RADY, //MT allows commands from TA/TE
- MBTK_CALL_UNAVAILABLE, //MT does not allow commands from TA/TE
- MBTK_CALL_UNKNOWN, //MT is not guaranteed to respond to instructions
- MBTK_CALL_RINGING, //MT is ready for commands from TA/TE, but the ringer is active
- MBTK_CALL_PROGRESS, //MT is ready for commands from TA/TE, but a call is in progress
- MBTK_CALL_ASLEEP, //MT is unable to process commands from TA/TE because it is in a low functionality state
- MBTK_CALL_ACTIVE,
- */
- switch (reg->pas)
- {
- case MBTK_CALL_RADY:
- printf("CALL: call READY\r\n");
- break;
- case MBTK_CALL_UNAVAILABLE:
- printf("CALL: call unavaliable\r\n");
- break;
- case MBTK_CALL_UNKNOWN:
- printf("CALL: call unknown\r\n");
- break;
- case MBTK_CALL_RINGING:
- printf("CALL: call ringing\r\n");
- break;
- case MBTK_CALL_PROGRESS:
- printf("CALL: call progress\r\n");
- break;
- case MBTK_CALL_ASLEEP:
- printf("CALL: call asleep\r\n");
- break;
- case MBTK_CALL_ACTIVE:
- printf("CALL: call active\r\n");
- break;
- default:
- printf("\r\n");
- break;
- }
- break;
- default:
- printf("\r\nRING : None call_wait = %d\r\n", reg->call_wait);
- break;
- }
- /*
- if(reg->call_wait == ) //CLCC
- {
- printf("\r\nRING : %d, %d, %d, %d, %d, %s, %d\r\n", reg->dir1, reg->dir, reg->state, reg->mode, reg->mpty, reg->phone_number, reg->type);
- }
- else if(reg->call_wait == 2) //Disconnected
- {
- printf("\r\nRING : call dis connected!\r\n");
- }
- else
- {
- printf("\r\nRING : None\r\n");
- }
- */
-}
-
-#ifdef MBTK_PLATFORM_ASR1803
-void lynq_dtmf_cb(char dtmf)
-{
- printf("%s:%c\n", __FUNCTION__, dtmf);
-}
-#endif
-
-int lynq_init_call(int uToken)
-{
- UNUSED(uToken);
-#ifdef MBTK_PLATFORM_ASR1803
- mbtk_audio_ubus_client_init(&lynq_dtmf_handle, lynq_dtmf_cb);
-#endif
- if(info_handle == NULL)
- {
- info_handle = mbtk_info_handle_get();
- if(info_handle)
- {
- int err = mbtk_call_state_change_cb_reg(info_handle, lynq_call_state_change_cb);
- if(err) {
- return -1;
- } else {
- return 0;
- }
- }
- }
-
- return -1;
-}
-
-int lynq_deinit_call(void)
-{
- if(info_handle)
- {
- return mbtk_info_handle_free(&info_handle);
- }
- else
- {
- return -1;
- }
-}
-
-int lynq_call(int *handle, char addr[])
-{
- if(info_handle == NULL)
- {
- return -1;
- }
- if(strlen(addr)>=90)
- {
- printf("\ninput phone number over load!\n");
- return -1;
- }
- char *buf = addr;
- int err = mbtk_call_start(info_handle, buf);
- if(err) {
- return -1;
- } else {
- handle_ptr = handle;
- return 0;
- }
-}
-
-int lynq_call_answer()
-{
- if(info_handle == NULL)
- {
- return -1;
- }
- int err = mbtk_call_answer(info_handle);
- if(err) {
- return -1;
- } else {
- return 0;
- }
-}
-
-int lynq_call_hungup_all()
-{
- if(info_handle == NULL)
- {
- return -1;
- }
- int err = mbtk_call_hang(info_handle);
- if(err) {
- return -1;
- } else {
- return 0;
- }
-}
-
-int lynq_call_hungup(int *handle)
-{
- if(info_handle == NULL)
- {
- return -1;
- }
- int err = mbtk_a_call_hang(info_handle, *handle);
- if(err) {
- return -1;
- } else {
- return 0;
- }
-}
-
-int lynq_hangup_waiting_or_background(void)
-{
- if(info_handle == NULL)
- {
- return -1;
- }
- int err = mbtk_waiting_or_background_call_hang(info_handle);
- if(err) {
- return -1;
- } else {
- return 0;
- }
-}
-
-int lynq_hangup_foreground_resume_background(void)
-{
- if(info_handle == NULL)
- {
- return -1;
- }
- int err = mbtk_foreground_resume_background_call_hang(info_handle);
- if(err) {
- return -1;
- } else {
- return 0;
- }
-}
-
-int lynq_switch_waiting_or_holding_and_active(void)
-{
- if(info_handle == NULL)
- {
- return -1;
- }
- int err = mbtk_call_answer(info_handle);
- if(err) {
- return -1;
- } else {
- return 0;
- }
-}
-
-int lynq_wait_incoming_call(void *incoming_call_cb)
-{
- if(incoming_call_cb == NULL)
- return -1;
- incoming_call_cb_p = incoming_call_cb;
- return 0;
-}
-
-int lynq_get_mute_mic (int *status)
-{
- if(status == NULL)
- {
- return -1;
- }
- int err = mbtk_mute_state_get(info_handle, status);
- if(err) {
- return -1;
- } else {
- return 0;
- }
-}
-
-int lynq_set_mute_mic(const int enable)
-{
- if(info_handle == NULL)
- {
- return -1;
- }
- int err = mbtk_mute_state_set(info_handle, enable);
- if(err) {
- return -1;
- } else {
- return 0;
- }
-}
-
-int lynq_set_DTMF(const char callnum)
-{
- //0......9 A B C D * #
- if(info_handle == NULL)
- {
- return -1;
- }
- char callnum_default[17]="0123456789ABCD*#";
- if((strchr(callnum_default,callnum))==NULL)
- {
- printf("please input 0123456789ABCD*#\n");
- return -1;
- }
- mbtk_call_dtmf_info_t dtmf_character;
- dtmf_character.character = callnum;
- dtmf_character.duration = 500;
- int err = mbtk_dtmf_send(info_handle, &dtmf_character);
- if(err) {
- return -1;
- } else {
- return 0;
- }
-}
-
-int lynq_get_current_call_state(int *handle,int *call_state,int*toa,int *direction,char addr[])
-{
- int flag=0;
- int i;
- for (i = 0; i < 5; i++)
- {
- if(lynq_reg[i].dir1 == *handle)
- {
- *direction = lynq_reg[i].dir;
- *toa = lynq_reg[i].type;
- memset(addr,0,sizeof(addr));
- memcpy(addr, lynq_reg[i].phone_number, strlen(lynq_reg[i].phone_number));
- int len = strlen(lynq_reg[i].phone_number);
- addr[len]='\0';
- switch (lynq_reg[i].state)
- {
- case MBTK_ACTIVE:
- *call_state = LYNQ_CALL_ACTIVE;
- break;
- case MBTK_HELD:
- *call_state = LYNQ_CALL_HOLDING;
- break;
- case MBTK_DIALING:
- *call_state = LYNQ_CALL_DIALING;
- break;
- case MBTK_ALERTING:
- *call_state = LYNQ_CALL_ALERTING;
- break;
- case MBTK_INCOMING:
- *call_state = LYNQ_CALL_INCOMING;
- break;
- case MBTK_WAITING:
- *call_state = LYNQ_CALL_WAITING;
- break;
- case MBTK_OFFERING:
- *call_state = LYNQ_CALL_OFFERING;
- break;
- default:
- break;
- }
- flag = 1;
- break;
- }
- }
- if(flag == 0)
- {
- return -1;
- }
- return 0;
-
- /*
- if(info_handle == NULL)
- {
- return -1;
- }
- int err = mbtk_call_reg_get(info_handle, ®);
- if(err) {
- return -1;
- } else {
- printf("CLCC : %d, %d, %d, %d, %d, %s, %d", reg.dir1, reg.dir, reg.state, reg.mode, reg.mpty, reg.phone_number, reg.type);
- *direction = reg.dir;
- *toa = reg.type;
- memcpy(addr, reg.phone_number, strlen(reg.phone_number));
- switch (reg.state)
- {
- case MBTK_ACTIVE:
- *call_state = LYNQ_CALL_ACTIVE;
- break;
- case MBTK_HELD:
- *call_state = LYNQ_CALL_HOLDING;
- break;
- case MBTK_DIALING:
- *call_state = LYNQ_CALL_DIALING;
- break;
- case MBTK_ALERTING:
- *call_state = LYNQ_CALL_ALERTING;
- break;
- case MBTK_INCOMING:
- *call_state = LYNQ_CALL_INCOMING;
- break;
- case MBTK_WAITING:
- *call_state = LYNQ_CALL_WAITING;
- break;
- case MBTK_OFFERING:
- *call_state = LYNQ_CALL_OFFERING;
- break;
- default:
- break;
- }
- return 0;
- }
- */
-
-}
-
-
-#ifdef MBTK_PLATFORM_ASR1803
-void lynq_audio_volume_cb(int volume)
-{
- lynq_volume_size = volume;
- if(lynq_volume_size <= 0 || lynq_volume_size > 100)
- {
-
- }
- else
- {
- //printf("%s:%d\n", __FUNCTION__, volume);
- printf("%s:%d\n", __FUNCTION__, lynq_volume_size);
- }
-}
-#endif
-
-int lynq_set_speech_volume(const int volume)
-{
-
-#ifdef MBTK_PLATFORM_ASR1803
- if(volume <= 0 || volume >= 101)
- {
- printf("input error\n");
- return -1;
- }
- else
- {
- int set_volume = 0;
- set_volume = volume;
- mbtk_audio_ubus_volume_set(set_volume);
- return 0;
- }
-#else
-
- return 0;
-#endif
-}
-
-int lynq_get_speech_volume(int * volume)
-{
-#ifdef MBTK_PLATFORM_ASR1803
- mbtk_audio_ubus_volume_get(lynq_audio_volume_cb);
- sleep(1);
- *volume = lynq_volume_size;
- return 0;
-#else
-
- return 0;
-#endif
-}
\ No newline at end of file
diff --git a/mbtk/lynq_lib/src/lynq_data_call.c b/mbtk/lynq_lib/src/lynq_data_call.c
new file mode 100755
index 0000000..fae8e3f
--- /dev/null
+++ b/mbtk/lynq_lib/src/lynq_data_call.c
@@ -0,0 +1,81 @@
+#include "lynq-qser-data.h"
+#include "mbtk_type.h"
+
+
+int qser_data_call_init(qser_data_call_evt_cb_t evt_cb)
+{
+ UNUSED(evt_cb);
+
+ return 0;
+}
+
+void qser_data_call_destroy(void)
+{
+
+}
+
+int qser_data_call_start(qser_data_call_s *data_call, qser_data_call_error_e *err)
+{
+ UNUSED(data_call);
+ UNUSED(err);
+
+ return 0;
+}
+
+int qser_data_call_stop(char profile_idx, qser_data_call_ip_family_e ip_family, qser_data_call_error_e *err)
+{
+ UNUSED(profile_idx);
+ UNUSED(ip_family);
+ UNUSED(err);
+
+ return 0;
+}
+
+int qser_data_call_info_get(char profile_idx,qser_data_call_ip_family_e ip_family,
+ qser_data_call_info_s *info, qser_data_call_error_e *err)
+{
+ UNUSED(profile_idx);
+ UNUSED(ip_family);
+ UNUSED(info);
+ UNUSED(err);
+
+ return 0;
+}
+
+int qser_apn_set(qser_apn_info_s *apn)
+{
+ UNUSED(apn);
+
+ return 0;
+}
+
+int qser_apn_get(unsigned char profile_idx, qser_apn_info_s *apn)
+{
+ UNUSED(profile_idx);
+ UNUSED(apn);
+
+ return 0;
+}
+
+int qser_apn_add(qser_apn_add_s *apn, unsigned char *profile_idx)
+{
+ UNUSED(apn);
+ UNUSED(profile_idx);
+
+ return 0;
+}
+
+int qser_apn_del(unsigned char profile_idx)
+{
+ UNUSED(profile_idx);
+
+ return 0;
+}
+
+int qser_apn_get_list(qser_apn_info_list_s *apn_list)
+{
+ UNUSED(apn_list);
+
+ return 0;
+}
+
diff --git a/mbtk/lynq_lib/src/lynq_fota.c b/mbtk/lynq_lib/src/lynq_fota.c
new file mode 100755
index 0000000..049bc08
--- /dev/null
+++ b/mbtk/lynq_lib/src/lynq_fota.c
@@ -0,0 +1,32 @@
+#include "lynq-qser-fota.h"
+#include "mbtk_type.h"
+
+int lynq_rock_main(int first_run)
+{
+ UNUSED(first_run);
+
+
+ return 0;
+}
+
+int lynq_fota_set_addr_value(char *value,int size)
+{
+ UNUSED(value);
+ UNUSED(size);
+
+
+ return 0;
+}
+
+int lynq_fota_nrestart(void)
+{
+
+ return 0;
+}
+
+int lynq_get_upgrade_status(void)
+{
+
+ return 0;
+}
+
diff --git a/mbtk/lynq_lib/src/lynq_gnss.c b/mbtk/lynq_lib/src/lynq_gnss.c
index 19c2d42..d86124c 100755
--- a/mbtk/lynq_lib/src/lynq_gnss.c
+++ b/mbtk/lynq_lib/src/lynq_gnss.c
@@ -1,212 +1,79 @@
-/**
- * \file gnss_test.c
- * \brief A Documented file.
- *
- * Detailed description
- * \Author: Sniper <e190@163.com>
- * \Version: 1.0.0
- * \Date: 2022-03-26
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <pthread.h>
-#include <errno.h>
-#include <termios.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <pthread.h>
-#include <termios.h>
-#include <sys/ioctl.h>
-#include "mbtk_type.h"
-#include "lynq/lynq_gnss.h"
+#include "lynq_gnss.h"
-#ifdef MBTK_GNSS_6228
-#include "mbtk_gnss_6228.h"
-
-static mbtk_gnss_client_handle _gnss_handle = 0;
-
-#else
-
-#endif
-
-
-static lynq_gnss_rx_ind_msg_handler_t handler_ptr = NULL;
-
-#ifdef MBTK_GNSS_6228
-void lynq_gnss_handler_function
-(
- mbtk_gnss_client_handle h_loc,
- int e_msg_id,
- void *pv_data,
- void *context_ptr
-)
+int qser_Gnss_Init (uint32_t *h_gnss)
{
- if(NULL == handler_ptr)
- return;
+ UNUSED(h_gnss);
- if(E_LYNQ_LOC_MSG_ID_NMEA_INFO == e_msg_id) {
- handler_ptr(h_loc, e_msg_id, pv_data, context_ptr);
- } else {
- }
-}
-//该函数用于进行GNSS初始化
-int lynq_gnss_init(void)
-{
- int ret=0;
-
- ret = mbtk_gnss_client_init(&_gnss_handle);
- if(ret < 0) {
- printf("mopen_gnss_client_init FAIL. ret:%d\n",ret);
- return -1;
- }
-
- return 0;
-}
-
-//该函数用于取消GNSS初始化
-int lynq_gnss_deinit(void)
-{
- int ret;
- if(0 == _gnss_handle) {
- return -1;
- }
-
- ret = mbtk_gnss_client_deinit(_gnss_handle);
- if(ret < 0) {
- printf("mopen_gnss_client_deinit FAIL. ret:%d\n",ret);
- return -1;
- }
-
- _gnss_handle = 0;
return 0;
}
-//该函数用于GNSS回调函数初始化
-
-int lynq_gnss_callback_reg(lynq_gnss_rx_ind_msg_handler_t handlerPtr)
+int qser_Gnss_Deinit (uint32_t h_gnss)
{
- int ret;
-
- if(0 == _gnss_handle) {
- return -1;
- }
- mbtk_gnss_print_version(_gnss_handle);
-
- ret = mbtk_gnss_add_rx_msg_handler(_gnss_handle, lynq_gnss_handler_function);
- if(0 == ret && handlerPtr)
- handler_ptr = handlerPtr;
- else
- return -1;
- return 0;
-}
-
-//该函数用于启动GNSS。
-int lynq_gnss_start(void)
-{
- if(0 == _gnss_handle) {
- return -1;
- }
-
- mbtk_gnss_set_mode(_gnss_handle, 0);
- return mbtk_gnss_set_mode(_gnss_handle, 3);
-}
-
-//该函数用于关闭GNSS。
-int lynq_gnss_stop(void)
-{
- if(0 == _gnss_handle) {
- return -1;
- }
-
- return mbtk_gnss_set_mode(_gnss_handle, 0);
-}
+ UNUSED(h_gnss);
-int lynq_gnss_agps_dataconnopen(void)
-{
- int ret;
-
- ret = mbtk_gnss_download_tle();
- if(ret)
- {
- printf("%s: download injects failed!!\n", __FUNCTION__);
- return -1;
- }
- return mbtk_gnss_injects_aidpos(_gnss_handle);
-}
-
-int lynq_gnss_dev_reset(void)
-{
- int ret = 0;
- if(_gnss_handle < 0)
- {
- return -1;
- }
- ret = mbtk_gnss_dev_reset(_gnss_handle, 0, 0);
- return ret;
-}
-
-int lynq_gnss_enable_glonass(void)
-{
- mbtk_gnss_firmware_update();
return 0;
}
-#else
-//该函数用于进行GNSS初始化
-int lynq_gnss_init(void)
-{
- return 0;
+int qser_AddRxIndMsgHandler (gnss_handler_func_t handler_ptr,uint32_t h_gnss)
+{
+ UNUSED(handler_ptr);
+ UNUSED(h_gnss);
+
+
+ return 0;
}
-//该函数用于取消GNSS初始化
-int lynq_gnss_deinit(void)
+int qser_Set_Indications (uint32_t h_gnss,e_msg_id_t type)
+{
+ UNUSED(h_gnss);
+ UNUSED(type);
+
+
+ return 0;
+}
+
+int qser_Gnss_Start (uint32_t h_gnss)
+{
+ UNUSED(h_gnss);
+
+ return 0;
+}
+
+int qser_Gnss_Stop (uint32_t h_gnss)
+{
+ UNUSED(h_gnss);
+
+ return 0;
+}
+
+int qser_Gnss_InjectTime (uint32_t h_gnss,LYNQ_INJECT_TIME_INTO_T *time_info)
+{
+ UNUSED(h_gnss);
+ UNUSED(time_info);
+
+ return 0;
+}
+
+int qser_Gnss_Delete_Aiding_Data (uint32_t h_gnss,DELETE_AIDING_DATA_TYPE_T flags)
+{
+ UNUSED(h_gnss);
+ UNUSED(flags);
+
+ return 0;
+}
+
+int qser_Gnss_download_tle()
{
return 0;
}
-//该函数用于GNSS回调函数初始化
-
-int lynq_gnss_callback_reg(lynq_gnss_rx_ind_msg_handler_t handlerPtr)
+int qser_Gnss_injectEphemeris(uint32_t h_gnss)
{
- UNUSED(handlerPtr);
+ UNUSED(h_gnss);
-
- return 0;
-}
-
-//该函数用于启动GNSS。
-int lynq_gnss_start(void)
-{
- return 0;
-}
-
-//该函数用于关闭GNSS。
-int lynq_gnss_stop(void)
-{
- return 0;
-}
-
-
-int lynq_gnss_agps_dataconnopen(void)
-{
return 0;
}
-int lynq_gnss_dev_reset(void)
-{
- return 0;
-}
-
-int lynq_gnss_enable_glonass(void)
-{
- return 0;
-}
-#endif
\ No newline at end of file
diff --git a/mbtk/lynq_lib/src/lynq_gpio.c b/mbtk/lynq_lib/src/lynq_gpio.c
new file mode 100755
index 0000000..ef1c522
--- /dev/null
+++ b/mbtk/lynq_lib/src/lynq_gpio.c
@@ -0,0 +1,62 @@
+#include "mbtk_type.h"
+#include "lynq-gpio.h"
+
+int lynq_gpio_init(int gpio, int direction, int value, int pullsel)
+{
+ UNUSED(gpio);
+ UNUSED(direction);
+ UNUSED(value);
+ UNUSED(pullsel);
+
+ return 0;
+}
+
+int lynq_gpio_deinit(int gpio)
+{
+ UNUSED(gpio);
+
+ return 0;
+}
+
+int lynq_gpio_direction_set(int gpio, int direction)
+{
+ UNUSED(gpio);
+ UNUSED(direction);
+
+ return 0;
+}
+
+
+int lynq_gpio_value_set(int gpio, int value)
+{
+ UNUSED(gpio);
+ UNUSED(value);
+
+ return 0;
+}
+
+int lynq_gpio_value_get(int gpio)
+{
+ UNUSED(gpio);
+
+ return 0;
+}
+
+int lynq_gpio_pullsel_set(int gpio, int pullsel)
+{
+ UNUSED(gpio);
+ UNUSED(pullsel);
+
+ return 0;
+}
+
+
+int lynq_gpio_pullsel_get(int gpio)
+{
+ UNUSED(gpio);
+
+ return 0;
+}
+
+
+
diff --git a/mbtk/lynq_lib/src/lynq_irq.c b/mbtk/lynq_lib/src/lynq_irq.c
new file mode 100755
index 0000000..ea63736
--- /dev/null
+++ b/mbtk/lynq_lib/src/lynq_irq.c
@@ -0,0 +1,43 @@
+#include "lynq-irq.h"
+#include "mbtk_type.h"
+
+int lynq_irq_install(int line, irq_handler irq_test_handler, int trig_type)
+{
+ UNUSED(line);
+ UNUSED(irq_test_handler);
+ UNUSED(trig_type);
+
+ return 0;
+}
+
+int lynq_irq_unstall(int line)
+{
+ UNUSED(line);
+
+ return 0;
+}
+
+int lynq_irq_set_type(int line, int trig_type)
+{
+ UNUSED(line);
+ UNUSED(trig_type);
+
+ return 0;
+}
+
+int lynq_set_wake(int line, int en)
+{
+ UNUSED(line);
+ UNUSED(en);
+
+ return 0;
+}
+
+int lynq_irq_get_wake(int line)
+{
+ UNUSED(line);
+
+ return 0;
+}
+
+
diff --git a/mbtk/lynq_lib/src/lynq_log.c b/mbtk/lynq_lib/src/lynq_log.c
new file mode 100755
index 0000000..7824d3f
--- /dev/null
+++ b/mbtk/lynq_lib/src/lynq_log.c
@@ -0,0 +1,124 @@
+#include "liblog.h"
+#include "mbtk_type.h"
+
+
+void lynq_log_configuration_init(const char *log_name)
+{
+ UNUSED(log_name);
+
+
+}
+
+void lynq_log_global_output(log_level_enum Level,const char *format,...)
+{
+ UNUSED(Level);
+ UNUSED(format);
+
+
+}
+
+int lynq_syslog_set_file_size(int value)
+{
+ UNUSED(value);
+
+ return 0;
+}
+
+int lynq_syslog_get_file_size(void)
+{
+
+ return -1;
+}
+
+int lynq_syslog_set_file_rotate(int value)
+{
+ UNUSED(value);
+
+ return 0;
+}
+
+int lynq_syslog_get_file_rotate(void)
+{
+
+ return 0;
+}
+
+int lynq_set_log_level(const char * module_name, log_level_enum level)
+{
+ UNUSED(module_name);
+ UNUSED(level);
+
+
+ return 0;
+}
+
+int lynq_get_log_level(const char * module_name, log_level_enum *level)
+{
+ UNUSED(module_name);
+ UNUSED(level);
+
+
+ return 0;
+}
+
+int lynq_set_special_log_level(const char * exe_name, const char * module_name, log_level_enum level)
+{
+ UNUSED(exe_name);
+ UNUSED(module_name);
+ UNUSED(level);
+
+
+ return 0;
+}
+
+int lynq_get_special_log_level(const char * exe_name, const char * module_name, log_level_enum *level)
+{
+ UNUSED(exe_name);
+ UNUSED(module_name);
+ UNUSED(level);
+
+
+ return 0;
+}
+
+int lynq_notify_recalc_log_level(pid_t pid)
+{
+ UNUSED(pid);
+
+ return 0;
+}
+
+void lynq_log_debug(const char *format,...)
+{
+ UNUSED(format);
+
+
+}
+
+void lynq_log_info(const char *format,...)
+{
+ UNUSED(format);
+
+
+}
+
+void lynq_log_warning(const char *format,...)
+{
+ UNUSED(format);
+
+
+}
+
+void lynq_log_error(const char *format,...)
+{
+ UNUSED(format);
+
+
+}
+
+void lynq_log_verbose(const char *format,...)
+{
+ UNUSED(format);
+
+
+}
diff --git a/mbtk/lynq_lib/src/lynq_net_api.c b/mbtk/lynq_lib/src/lynq_net_api.c
deleted file mode 100755
index f2195e0..0000000
--- a/mbtk/lynq_lib/src/lynq_net_api.c
+++ /dev/null
@@ -1,708 +0,0 @@
-#include "lynq/lynq_net_api.h"
-
-static mbtk_info_handle_t* info_handle = NULL;
-
-typedef struct
-{
- uint8 *operator_l;
- uint8 *operator_s;
- uint32 mcc_mnc;
-} operator_mcc_mnc_t;
-
-static operator_mcc_mnc_t operator_mcc_mnc[] =
-{
- {"China Mobile","CMCC",46000},
- {"China Unicom","CU",46001},
- {"China Mobile","CMCC",46002},
- {"China Telecom","CT",46003},
- {"China Mobile","CMCC",46004},
- {"China Telecom","CT",46005},
- {"China Unicom","CU",46006},
- {"China Mobile","CMCC",46007},
- {"China Mobile","CMCC",46008},
- {"China Unicom","CU",46009},
- {"China Telecom","CT",46011}
-};
-
-int lynq_network_init(int uToken)
-{
- UNUSED(uToken);
- if(info_handle == NULL)
- {
- info_handle = mbtk_info_handle_get();
- if(info_handle)
- {
- return 0;
- }
- }
-
- return -1;
-}
-
-int lynq_network_deinit(void)
-{
- if(info_handle)
- {
- return mbtk_info_handle_free(&info_handle);
- }
- else
- {
- return -1;
- }
-}
-
-int lynq_get_version(char buf[])
-{
- if(info_handle == NULL || buf == NULL)
- {
- return -1;
- }
-
- int err = mbtk_version_get(info_handle, buf);
- if(err) {
- return -1;
- } else {
- return 0;
- }
-}
-
-int lynq_get_imei(char buf[])
-{
- if(info_handle == NULL || buf == NULL)
- {
- return -1;
- }
-
- int err = mbtk_imei_get(info_handle, buf);
- if(err) {
- return -1;
- } else {
- return 0;
- }
-}
-
-int lynq_get_sn(char buf[])
-{
- if(info_handle == NULL || buf == NULL)
- {
- return -1;
- }
-
- int err = mbtk_sn_get(info_handle, buf);
- if(err) {
- return -1;
- } else {
- return 0;
- }
-}
-
-int lynq_get_zone_tmp(ZONE_NUM num, int *temp)
-{
- if(info_handle == NULL || temp == NULL)
- {
- return -1;
- }
-
- return mbtk_temp_get(info_handle, num, temp);
-}
-
-int lynq_shutdown(char options[])
-{
- if(options == NULL)
- {
- return -1;
- }
-
- if(!strcmp(options, "reboot")) {
- return mbtk_system_reboot(0);
- } else if(!strcmp(options, "poweroff")) {
- return mbtk_system_reboot(1);
- } else if(!strcmp(options, "halt")) {
- return mbtk_system_reboot(2);
- } else {
- return -1;
- }
- return 0;
-}
-
-int lynq_time_set(mbtk_time_type_enum time_type, char* time_str)
-{
- if(info_handle == NULL)
- {
- return -1;
- }
-
- return mbtk_time_set(info_handle, time_type, time_str);
-}
-
-int lynq_get_sim_status(int *card_status)
-{
- if(info_handle == NULL || card_status == NULL)
- {
- return -1;
- }
-
- mbtk_sim_state_enum sim;
- int err = mbtk_sim_state_get(info_handle, &sim);
- if(err) {
- return -1;
- } else {
- *card_status = sim;
- return 0;
- }
-}
-
-int lynq_get_imsi(char buf[])
-{
- if(info_handle == NULL || buf == NULL)
- {
- return -1;
- }
-
- int err = mbtk_imsi_get(info_handle, buf);
- if(err) {
- return -1;
- } else {
- return 0;
- }
-}
-
-int lynq_get_iccid(char buf[])
-{
- if(info_handle == NULL || buf == NULL)
- {
- return -1;
- }
-
- int err = mbtk_iccid_get(info_handle, buf);
- if(err) {
- return -1;
- } else {
- return 0;
- }
-}
-
-int lynq_query_phone_number(char buf[])
-{
- if(info_handle == NULL || buf == NULL)
- {
- return -1;
- }
-
- int err = mbtk_phone_number_get(info_handle, buf);
- if(err) {
- return -1;
- } else {
- return 0;
- }
-}
-
-int lynq_sim_power (int mode)
-{
- if(mode != 0 && mode != 1)
- {
- return -1;
- }
-
- return mbtk_sim_power_set(mode);
-}
-
-int lynq_query_operater(char *OperatorFN,char *OperatorSH,char *MccMnc)
-{
- if(info_handle == NULL || OperatorFN == NULL || OperatorSH == NULL || MccMnc == NULL)
- {
- return -1;
- }
-
- mbtk_net_info_t net;
- if(!mbtk_net_sel_mode_get(info_handle, &net) && net.plmn > 0)
- {
- // printf("Net : %d, %d, %d\n", net.net_sel_mode, net.net_type, net.plmn);
- int i = 0;
- while(i < ARRAY_SIZE(operator_mcc_mnc))
- {
- if(operator_mcc_mnc[i].mcc_mnc == net.plmn)
- break;
- i++;
- }
-
- if(i == ARRAY_SIZE(operator_mcc_mnc)) // No found mcc&mnc
- {
- strcpy(OperatorFN, "UNKNOWN");
- strcpy(OperatorSH, "UNKNOWN");
- sprintf(MccMnc, "%d", net.plmn);
- }
- else
- {
- strcpy(OperatorFN, operator_mcc_mnc[i].operator_l);
- strcpy(OperatorSH, operator_mcc_mnc[i].operator_s);
- sprintf(MccMnc, "%d", operator_mcc_mnc[i].mcc_mnc);
- }
- return 0;
- }
-
- return -1;
-}
-
-int lynq_query_network_selection_mode (int *netselMode)
-{
- if(info_handle == NULL || netselMode == NULL)
- {
- return -1;
- }
-
- mbtk_net_info_t net;
- if(!mbtk_net_sel_mode_get(info_handle, &net))
- {
- // printf("Net : %d, %d, %d\n", net.net_sel_mode, net.net_type, net.plmn);
- *netselMode = net.net_sel_mode;
- return 0;
- }
-
- return -1;
-}
-
-int lynq_set_network_selection_mode(const char *mode, const char* mccmnc)
-{
- if(info_handle == NULL || str_empty(mode))
- {
- return -1;
- }
-
- mbtk_net_info_t net;
- net.net_type = 0xFF;
- if(!strcmp(mode, "Auto"))
- {
- net.net_sel_mode = 0;
- net.plmn = 0;
- }
- else if(!strcmp(mode, "Manual") && !str_empty(mccmnc))
- {
- net.net_sel_mode = 1;
- net.plmn = (uint32)atoi(mccmnc);
- }
- else
- {
- return -1;
- }
- if(!mbtk_net_sel_mode_set(info_handle, &net))
- {
- return 0;
- }
-
- return -1;
-}
-
-int lynq_query_available_network(list_node_t** net_list)
-{
- if(info_handle == NULL)
- {
- return -1;
- }
-
- return mbtk_available_net_get(info_handle, net_list);
-}
-
-int lynq_query_registration_state(const char *type, int* regState,int *imsRegState,char * LAC,char *CID,int *netType,int * radioTechFam,int *netRejected)
-{
- if(info_handle == NULL || str_empty(type) || regState == NULL || imsRegState == NULL
- || LAC == NULL || CID == NULL || netType == NULL || radioTechFam == NULL || netRejected == NULL)
- {
- return -1;
- }
- mbtk_net_reg_info_t reg;
- int err = mbtk_net_reg_get(info_handle, ®);
- if(err) {
- *netRejected = err;
- return -1;
- } else {
- //printf("REG : %d, %d, %d, %04x, %08o\n", reg.state, reg.type, reg.ims_reg, reg.lac, reg.ci);
- // Voice/Data/IMS
- if(strcmp("Voice", type) == 0) {
- *regState = reg.call_state;
- } else if(strcmp("Data", type) == 0) {
- *regState = reg.data_state;
- } else if(strcmp("IMS", type) == 0) {
- *imsRegState = reg.ims_state;
- } else {
- return -1;
- }
-
- if(reg.call_state != MBTK_NET_REG_STATE_NON || reg.data_state != MBTK_NET_REG_STATE_NON || reg.ims_state != MBTK_NET_REG_STATE_NON) {
- sprintf(LAC, "%04x", reg.lac);
- sprintf(CID, "%08o", reg.ci);
- *netType = reg.type;
- *radioTechFam = RADIO_TECH_3GPP;
- }
- return 0;
- }
-}
-
-int lynq_query_prefferred_networktype (int *preNetType)
-{
- if(info_handle == NULL || preNetType == NULL)
- {
- return -1;
- }
-
- mbtk_band_info_t band;
- int err = mbtk_current_band_get(info_handle, &band);
- if(err) {
- return -1;
- } else {
- //printf("Band : %d, %d, %d, %d, %d\n", band.net_pref, band.gsm_band, band.umts_band, band.tdlte_band, band.fddlte_band);
- *preNetType = band.net_pref;
- return 0;
- }
-}
-
-int lynq_set_prefferred_networktype (const int preNetType)
-{
-
- if(info_handle == NULL)
- {
- return -1;
- }
- if(preNetType < 0 || preNetType > 15)
- {
- return -2;
- }
- mbtk_band_info_t band;
- memset(&band, 0, sizeof(mbtk_band_info_t));
- band.net_pref = preNetType;
- int err = mbtk_current_band_set(info_handle, &band);
- if(err) {
- return -1;
- } else {
- return 0;
- }
-}
-
-int lynq_set_band_mode(int gsm_band, int umts_band, int tdlte_band, int fddlte_band)
-{
- if(info_handle == NULL)
- {
- return -1;
- }
-
- mbtk_band_info_t band;
- band.net_pref = 0xFF; // No change network pref.
- band.gsm_band = (uint16)gsm_band;
- band.umts_band = (uint16)umts_band;
- band.tdlte_band = (uint32)tdlte_band;
- band.fddlte_band = (uint32)fddlte_band;
- int err = mbtk_current_band_set(info_handle, &band);
- if(err) {
- return -1;
- } else {
- return 0;
- }
-}
-
-int lynq_query_available_bandmode (int *gsm_band, int *umts_band, int *tdlte_band, int *fddlte_band)
-{
- if(info_handle == NULL || gsm_band == NULL || umts_band == NULL || tdlte_band == NULL || fddlte_band == NULL)
- {
- return -1;
- }
-
- mbtk_band_info_t band;
- int err = mbtk_support_band_get(info_handle, &band);
- if(err) {
- return -1;
- } else {
- //printf("Band : %d, %d, %d, %d, %d\n", band.net_pref, band.gsm_band, band.umts_band, band.tdlte_band, band.fddlte_band);
- *gsm_band = band.gsm_band;
- *umts_band = band.umts_band;
- *tdlte_band = band.tdlte_band;
- *fddlte_band = band.fddlte_band;
- return 0;
- }
-}
-
-int lynq_radio_on (const int data)
-{
- if(info_handle == NULL || (data != 0 && data != 1))
- {
- return -1;
- }
-
- int err = mbtk_radio_state_set(info_handle, data);
- if(err) {
- return -1;
- } else {
- return 0;
- }
-}
-
-int lynq_query_radio_tech (int* radioTech)
-{
- if(info_handle == NULL || radioTech == NULL)
- {
- return -1;
- }
-
- int err = mbtk_radio_state_get(info_handle, radioTech);
- if(err) {
- return -1;
- } else {
- return 0;
- }
-}
-
-int lynq_solicited_signal_strength (signalStrength_t *solSigStren)
-{
- if(info_handle == NULL || solSigStren == NULL)
- {
- return -1;
- }
-
- mbtk_signal_info_t signal;
- int err = mbtk_net_signal_get(info_handle, &signal);
- if(err) {
- return -1;
- } else {
- memset(solSigStren, 0, sizeof(signalStrength_t));
- switch(mbtk_net_type_get(signal.type))
- {
- case MBTK_NET_TYPE_GSM:
- solSigStren->gsm_sig_valid = 1;
- break;
- case MBTK_NET_TYPE_UMTS:
- solSigStren->umts_sig_valid = 1;
- break;
- case MBTK_NET_TYPE_LTE:
- solSigStren->lte_sig_valid = 1;
- break;
- default:
- break;
- }
- solSigStren->rssi = signal.rssi;
- solSigStren->ber = signal.ber;
- solSigStren->rxlev = signal.rxlev;
- solSigStren->rscp = signal.rscp;
- solSigStren->ecno = signal.ecno;
- solSigStren->rsrq = signal.rsrq;
- solSigStren->rsrp = signal.rsrp;
- return 0;
- }
-}
-
-int lynq_set_ims (const int ims_mode)
-{
- if(info_handle == NULL || (ims_mode != 0 && ims_mode != 1))
- {
- return -1;
- }
-
- int err = mbtk_volte_state_set(info_handle, ims_mode);
- if(err) {
- return -1;
- } else {
- return 0;
- }
-}
-
-int lynq_init_cell(void)
-{
- if(info_handle == NULL)
- {
- info_handle = mbtk_info_handle_get();
- if(info_handle)
- {
- printf("creat info_handle is success\n");
- }
- else{
- printf("creat info_handle is fail\n");
- return -1;
- }
- }
-
- return 0;
-}
-
-int lynq_deinit_cell(void)
-{
- if(info_handle)
- {
- return mbtk_info_handle_free(&info_handle);
- }
- else
- {
- return -1;
- }
-}
-
-/*
-* Get current cell infomation.
-*/
-int lynq_query_cell_info(int *type, list_node_t **cell_list)
-{
- if(info_handle == NULL || type == NULL)
- {
- return -1;
- }
-
- return mbtk_cell_get(info_handle, type, cell_list);
-}
-
-/*
-* set current cell infomation.
-*/
-void lynq_set_cell_info(char *mem)
-{
- if(info_handle == NULL || mem == NULL)
- {
- return -1;
- }
-
- char resp[1024] = {0};
- mbtk_cell_set(info_handle, mem, resp);
-
- return ;
-}
-
-/*
-* Set specific APN informations.
-*
-* cid : 2-7
-*/
-int lynq_apn_set(int cid, mbtk_ip_type_enum ip_type, const void* apn_name,
- const void *user_name, const void *user_pass, const void *auth)
-{
- if(info_handle == NULL || str_empty(apn_name))
- {
- return -1;
- }
-
- return mbtk_apn_set(info_handle, cid, ip_type, apn_name, user_name, user_pass, auth);
-}
-
-/*
-* Get current all APN informations.
-*/
-int lynq_apn_get(int *apn_num, mbtk_apn_info_t apns[])
-{
- if(info_handle == NULL || apn_num == NULL || apns == NULL)
- {
- return -1;
- }
-
- return mbtk_apn_get(info_handle, apn_num, apns);
-}
-
-/*
-* Start data call.
-*/
-int lynq_data_call_start(int cid, int timeout)
-{
- if(info_handle == NULL)
- {
- return -1;
- }
-
- return mbtk_data_call_start(info_handle, cid, 0, FALSE, timeout);
-}
-
-/*
-* Stop data call.
-*/
-int lynq_data_call_stop(int cid, int timeout)
-{
- if(info_handle == NULL)
- {
- return -1;
- }
-
- return mbtk_data_call_stop(info_handle, cid, timeout);
-}
-
-/*
-* Query data call state.
-*/
-int lynq_data_call_query(int cid, mbtk_ipv4_info_t *ipv4, mbtk_ipv6_info_t *ipv6)
-{
- if(info_handle == NULL || ipv4 == NULL || ipv6 == NULL)
- {
- return -1;
- }
-
- return mbtk_data_call_state_get(info_handle, cid, ipv4, ipv6);
-}
-
-/*
- * Get the native ip and free port.
- */
-int lynq_get_ip_and_port(char *ipBuf_out,int *port,int iptype)
-{
- char psz_port_cmd[128];
- int i=0;
-
- *port = rand() % (60000 - 50000 + 1) + 50000;
- sprintf(psz_port_cmd, "netstat -an | grep :%d > /dev/null", *port);
-
- char ipBuf[32] = "";
- FILE *fstream=NULL;
-
- char buff[1024];
- char iptype_str[8];
- memset(buff,0,sizeof(buff));
- /*eth0????eth1?docker0?em1?lo?*/
- if(iptype == 1)
- {
-
- if(NULL==(fstream=popen("ifconfig ccinet0 | grep \"inet6 addr: 2\" | awk '{print $3}'","r")))
- {
- snprintf(ipBuf, 39, "%s","0:0:0:0:0:0:0:0");
- }
- if(NULL!=fgets(buff, sizeof(buff), fstream))
- {
- snprintf(ipBuf, 39, "%s",buff);
- }
- else
- {
- snprintf(ipBuf, 39, "%s","0:0:0:0:0:0:0:0");
- pclose(fstream);
- }
- }
- else if(iptype == 0)
- {
- if(NULL==(fstream=popen("ifconfig ccinet0 | grep \"inet addr:\" | awk \'{print $2}\' | cut -c 6-","r")))
- {
- snprintf(ipBuf, 18, "%s","0.0.0.0");
- }
- if(NULL!=fgets(buff, sizeof(buff), fstream))
- {
- snprintf(ipBuf, 18, "%s",buff);
- }
- else
- {
- snprintf(ipBuf, 18, "%s","0.0.0.0");
- pclose(fstream);
- }
- }
- else
- {
- return -1;
- }
- pclose(fstream);
-
- printf("ip:%s\n", ipBuf);
- memcpy(ipBuf_out, ipBuf, 32);
- return 0;
-}
-
-int lynq_get_modem_fun(MBTK_DEV_MODEM_FUNCTION *fun)
-{
- if(info_handle == NULL)
- {
- return -1;
- }
-
- int err = mbtk_get_modem_fun(info_handle, fun);
- if(err) {
- return -1;
- } else {
- return 0;
- }
-}
diff --git a/mbtk/lynq_lib/src/lynq_net_light.c b/mbtk/lynq_lib/src/lynq_net_light.c
new file mode 100755
index 0000000..34394af
--- /dev/null
+++ b/mbtk/lynq_lib/src/lynq_net_light.c
@@ -0,0 +1,17 @@
+#include "lynq_led.h"
+#include "mbtk_type.h"
+
+int lynq_set_netled_on(int led_mode)
+{
+ UNUSED(led_mode);
+
+ return 0;
+}
+
+int lynq_set_statusled_on(int led_mode)
+{
+ UNUSED(led_mode);
+
+ return 0;
+}
+
diff --git a/mbtk/lynq_lib/src/lynq_network.c b/mbtk/lynq_lib/src/lynq_network.c
new file mode 100755
index 0000000..5212da5
--- /dev/null
+++ b/mbtk/lynq_lib/src/lynq_network.c
@@ -0,0 +1,72 @@
+#include "lynq_qser_network.h"
+
+int qser_nw_client_init(nw_client_handle_type *ph_nw)
+{
+ UNUSED(ph_nw);
+
+ return 0;
+}
+
+int qser_nw_client_deinit(nw_client_handle_type h_nw)
+{
+ UNUSED(h_nw);
+
+ return 0;
+}
+
+int qser_nw_set_config(nw_client_handle_type h_nw,QSER_NW_CONFIG_INFO_T *pt_info)
+{
+ UNUSED(h_nw);
+ UNUSED(pt_info);
+
+ return 0;
+}
+
+int qser_nw_get_operator_name(nw_client_handle_type h_nw, QSER_NW_OPERATOR_NAME_INFO_T *pt_info)
+{
+ UNUSED(h_nw);
+ UNUSED(pt_info);
+
+ return 0;
+}
+
+int qser_nw_get_reg_status(nw_client_handle_type h_nw, QSER_NW_REG_STATUS_INFO_T *pt_info)
+{
+ UNUSED(h_nw);
+ UNUSED(pt_info);
+
+ return 0;
+}
+
+int qser_nw_get_signal_strength(nw_client_handle_type h_nw,QSER_NW_SIGNAL_STRENGTH_INFO_T *pt_info)
+{
+ UNUSED(h_nw);
+ UNUSED(pt_info);
+
+ return 0;
+}
+
+int qser_nw_add_rx_msg_handler (nw_client_handle_type h_nw, QSER_NW_RxMsgHandlerFunc_t handlerPtr, void* contextPtr)
+{
+ UNUSED(h_nw);
+ UNUSED(handlerPtr);
+ UNUSED(contextPtr);
+
+ return 0;
+}
+
+int qser_nw_set_oos_config (nw_client_handle_type h_nw, QSER_NW_OOS_CONFIG_INFO_T *pt_info)
+{
+ UNUSED(h_nw);
+ UNUSED(pt_info);
+
+ return 0;
+}
+
+int qser_nw_get_oos_config (nw_client_handle_type h_nw, QSER_NW_OOS_CONFIG_INFO_T *pt_info)
+{
+ UNUSED(h_nw);
+ UNUSED(pt_info);
+
+ return 0;
+}
\ No newline at end of file
diff --git a/mbtk/lynq_lib/src/lynq_sim.c b/mbtk/lynq_lib/src/lynq_sim.c
new file mode 100755
index 0000000..6bb6ed1
--- /dev/null
+++ b/mbtk/lynq_lib/src/lynq_sim.c
@@ -0,0 +1,96 @@
+#include "lynq_qser_sim.h"
+#include "mbtk_type.h"
+
+int qser_sim_client_init(sim_client_handle_type *ph_sim)
+{
+ UNUSED(ph_sim);
+
+ return 0;
+}
+
+int qser_sim_getimsi(sim_client_handle_type h_sim, QSER_SIM_APP_ID_INFO_T *pt_info,char *imsi,size_t imsiLen)
+{
+ UNUSED(h_sim);
+ UNUSED(pt_info);
+ UNUSED(imsi);
+ UNUSED(imsiLen);
+
+ return 0;
+}
+
+int qser_sim_geticcid(sim_client_handle_type h_sim,QSER_SIM_SLOT_ID_TYPE_T simId,char *iccid, size_t iccidLen)
+{
+ UNUSED(h_sim);
+ UNUSED(simId);
+ UNUSED(iccid);
+ UNUSED(iccidLen);
+
+ return 0;
+}
+
+int qser_sim_getphonenumber(sim_client_handle_type h_sim,QSER_SIM_APP_ID_INFO_T *pt_info, char*phone_num, size_t phoneLen)
+{
+ UNUSED(h_sim);
+ UNUSED(pt_info);
+ UNUSED(phone_num);
+ UNUSED(phoneLen);
+
+ return 0;
+}
+
+int qser_sim_verifypin(sim_client_handle_type h_sim,QSER_SIM_VERIFY_PIN_INFO_T *pt_info)
+{
+ UNUSED(h_sim);
+ UNUSED(pt_info);
+
+ return 0;
+}
+
+int qser_sim_changepin(sim_client_handle_type h_sim,QSER_SIM_CHANGE_PIN_INFO_T *pt_info)
+{
+ UNUSED(h_sim);
+ UNUSED(pt_info);
+
+ return 0;
+}
+
+int qser_sim_unblockpin(sim_client_handle_type h_sim, QSER_SIM_UNBLOCK_PIN_INFO_T *pt_info)
+{
+ UNUSED(h_sim);
+ UNUSED(pt_info);
+
+ return 0;
+}
+
+int qser_sim_enablepin(sim_client_handle_type h_sim, QSER_SIM_ENABLE_PIN_INFO_T *pt_info)
+{
+ UNUSED(h_sim);
+ UNUSED(pt_info);
+
+ return 0;
+}
+
+int qser_sim_disablepin(sim_client_handle_type h_sim, QSER_SIM_DISABLE_PIN_INFO_T *pt_info)
+{
+ UNUSED(h_sim);
+ UNUSED(pt_info);
+
+ return 0;
+}
+
+int qser_sim_getcardstatus(sim_client_handle_type h_sim,QSER_SIM_SLOT_ID_TYPE_T simId,QSER_SIM_CARD_STATUS_INFO_T *pt_info)
+{
+ UNUSED(h_sim);
+ UNUSED(simId);
+ UNUSED(pt_info);
+
+ return 0;
+}
+
+int qser_sim_client_deinit(sim_client_handle_type h_sim)
+{
+ UNUSED(h_sim);
+
+ return 0;
+}
+
diff --git a/mbtk/lynq_lib/src/lynq_sleep.c b/mbtk/lynq_lib/src/lynq_sleep.c
new file mode 100755
index 0000000..59a363f
--- /dev/null
+++ b/mbtk/lynq_lib/src/lynq_sleep.c
@@ -0,0 +1,41 @@
+#include "lynq-qser-autosuspend.h"
+#include "mbtk_type.h"
+
+int qser_autosuspend_enable(char enable)
+{
+ UNUSED(enable);
+
+ return 0;
+}
+
+int qser_wakelock_create(const char* name , size_t len)
+{
+ UNUSED(name);
+ UNUSED(len);
+
+ return 0;
+}
+
+int qser_wakelock_lock(int fd)
+{
+ UNUSED(fd);
+
+ return 0;
+}
+
+int qser_wakelock_unlock(int fd)
+{
+ UNUSED(fd);
+
+ return 0;
+}
+
+int qser_wakelock_destroy(int fd)
+{
+ UNUSED(fd);
+
+ return 0;
+}
+
+
+
diff --git a/mbtk/lynq_lib/src/lynq_sms.c b/mbtk/lynq_lib/src/lynq_sms.c
new file mode 100755
index 0000000..5699e52
--- /dev/null
+++ b/mbtk/lynq_lib/src/lynq_sms.c
@@ -0,0 +1,57 @@
+#include "lynq_qser_sms.h"
+#include "mbtk_type.h"
+
+int qser_sms_client_init(sms_client_handle_type *ph_sms)
+{
+ UNUSED(ph_sms);
+
+ return 0;
+}
+
+int qser_sms_client_deinit(sms_client_handle_type h_sms)
+{
+ UNUSED(h_sms);
+
+ return 0;
+}
+
+int qser_sms_send_sms(sms_client_handle_type h_sms, QSER_sms_info_t *pt_sms_info)
+{
+ UNUSED(h_sms);
+ UNUSED(pt_sms_info);
+
+ return 0;
+}
+
+int qser_sms_addrxmsghandler(QSER_SMS_RxMsgHandlerFunc_t handlerPtr, void* contextPtr)
+{
+ UNUSED(handlerPtr);
+ UNUSED(contextPtr);
+
+ return 0;
+}
+
+int qser_sms_deletefromstorage(sms_client_handle_type h_sms, QSER_sms_storage_info_t *pt_sms_storage)
+{
+ UNUSED(h_sms);
+ UNUSED(pt_sms_storage);
+
+ return 0;
+}
+
+int qser_sms_getsmscenteraddress( sms_client_handle_type h_sms,QSER_sms_service_center_cfg_t *set_sca_cfg)
+{
+ UNUSED(h_sms);
+ UNUSED(set_sca_cfg);
+
+ return 0;
+}
+
+int qser_sms_setsmscenteraddress( sms_client_handle_type h_sms, QSER_sms_service_center_cfg_t *get_sca_cfg)
+{
+ UNUSED(h_sms);
+ UNUSED(get_sca_cfg);
+
+ return 0;
+}
+
diff --git a/mbtk/lynq_lib/src/lynq_sms_api.c b/mbtk/lynq_lib/src/lynq_sms_api.c
deleted file mode 100755
index 4fa4007..0000000
--- a/mbtk/lynq_lib/src/lynq_sms_api.c
+++ /dev/null
@@ -1,291 +0,0 @@
-#include "lynq/lynq_sms_api.h"
-#include "mbtk_info_api.h"
-
-
-static mbtk_info_handle_t* info_handle = NULL;
-
-
-void lynq_sms_state_change_cb(const void* data, int data_len)
-{
- LOGV("sms_state_change_cb()----------start\n");
- uint8 *ptr = (uint8*)data;
- printf("3sms_state_change_cb() : %s\n", ptr);
-
- struct SMS_Struct s = PDUDecoding(ptr);
- printf("服务中心地址: %s\n", s.SCA);
- printf("发送方地址: %s\n", s.OA);
- printf("服务中心时间戳: %s\n", s.SCTS);
- printf("消息内容: %s\n", s.UD);
- printf("数据编码方案: %s\n", DSC_to_msg(s.DCS));
-}
-
-
-int lynq_init_sms(int uToken)
-{
- UNUSED(uToken);
- if(info_handle == NULL)
- {
- info_handle = mbtk_info_handle_get();
- if(info_handle)
- {
- printf("creat info_handle is success\n");
- }
- else{
- printf("creat info_handle is fail\n");
- return -1;
- }
- }
-
- return 0;
-}
-
-int lynq_deinit_sms(void)
-{
- if(info_handle)
- {
- return mbtk_info_handle_free(&info_handle);
- }
- else
- {
- return -1;
- }
-}
-
-
-/*
-*AT+CMGS="10086", CMGS TEST // Send a SMS
-> CMGS TEST
-+CMGS: 17
-OK
-*/
-/*
-int charset: send sms mode
- 0:pdu, 1:text
-
-*/
-
-int lynq_send_sms(char *telephony_num, int state, char *msg)
-{
- if(info_handle == NULL || msg == NULL || telephony_num == NULL)
- {
- return -1;
- }
-
- char cmgs[MSM_NUMBER_MAX] = {0};
- char resp[RES_NUM_MIN] = {0};
- int mode = 0;
- int err = 0;
- if(strlen(msg) > 512 || strlen(msg) == 0 || strlen(telephony_num) == 0)
- {
- printf("strlen(telephony_num):%d\n", strlen(telephony_num));
- printf("strlen(msg):%d\n", strlen(msg));
- return -1;
- }
-
- if(state) // text
- {
- mode = 1;
- }
-
- err = mbtk_sms_cmgf_set(info_handle, mode);
- if(err) {
- printf("cmgf set error : %d\n", err);
- } else {
- printf("cmgf set success\n");
- }
-
- sprintf(cmgs,"%s,%s",telephony_num, msg);
- printf("cmgs:%s\n", cmgs);
-
-/* char *ptr = strstr(cmd, "cmgs,"); //CMGS="10086",hf
- if(ptr != NULL)
- {
- ptr = strstr(cmd, ",");
- ptr++;
- memset(cmgs, 0, sizeof(cmgs));
- memcpy(cmgs, ptr, strlen(ptr));
- printf("1cmgs:%s, strlen(cmgs):%d\n", cmgs, strlen(cmgs));
- }
-*/
-
- memset(resp, 0, sizeof(resp));
-
- err = mbtk_sms_cmgs_set(info_handle, cmgs, resp);
- if(err) {
- printf("Error : %d\n", err);
- return -1;
- } else {
- printf("cmgs set success . resp:%s\n", resp);
- }
-
- return 0;
-}
-
-int lynq_wait_receive_new_sms(int *handle)
-{
- if(info_handle == NULL)
- {
- return -1;
- }
-
- int ret = mbtk_sms_cnmi_set(info_handle);
- if(ret)
- {
- printf("set cnmi fail\n");
- return -1;
- }
-
- mbtk_sms_state_change_cb_reg(info_handle, lynq_sms_state_change_cb);
- return 0;
-}
-
-/*
- AT+CMGD=<index>[,<delflag>]
-
- Deletes message based on index
- node:
- index is -1, delete all message
- delflag set 4
-*/
-int lynq_delete_sms(int index)
-{
- char cmgd[128] = {0};
- int err = 0;
-
- if(index == -1) //delete all
- {
- memcpy(cmgd, ",4", strlen(",4"));
- }
- else
- {
- sprintf(cmgd,"%d",index);
- }
-
- printf("cmgd:%s\n", cmgd);
-
- err = mbtk_sms_cmgd_set(info_handle, cmgd);
- if(err) {
- printf("lynq_delete_sms Error : %d\n", err);
- return -1;
- } else {
- printf("lynq_delete_sms set success\n");
- }
-
- return 0;
-}
-
-
-/*
-function: lynq_list_sms
-stat:0:pud, 1:text
-index: 0, list index;
- > 0,
-
-*/
-int lynq_list_sms(int stat, int index, char *data)
-{
- if(info_handle == NULL)
- {
- return -1;
- }
-
- char cmgs[MSM_NUMBER_MAX] = {0};
- int mode = 0;
- int err = 0;
-
- if(stat) // text
- {
- mode = 1;
- }
-
- err = mbtk_sms_cmgf_set(info_handle, mode);
- if(err) {
- printf("cmgf set error : %d\n", err);
- } else {
- printf("cmgf set success\n");
- }
-
-
- char cmgl[128] = {0};
- char resp[1024+1] ={0};
- sprintf(cmgl,"%d,%s", index, data);
-/*
- char *ptr = strstr(cmd, "cmgl,"); // AT+CMGL[=<stat>]
- if(ptr != NULL)
- {
- ptr = strstr(cmd, ",");
- ptr++;
- memset(cmgl, 0, sizeof(cmgl));
- memcpy(cmgl, ptr, strlen(ptr));
- printf("0cmgl:%s\n", cmgl);
- }
-*/
- memset(resp, 0, sizeof(resp));
- err = mbtk_sms_cmgl_set(info_handle, cmgl, resp);
- if(err) {
- printf("lynq_list_sms Error : %d\n", err);
- return -1;
- } else {
- printf("cmgl set success, reg:%s\n",resp);
- }
-
- return 0;
-}
-
-
-int lynq_query_sms_storage_status(void)
-{
- char mem[128] = {0};
- int err = mbtk_sms_cpms_get(info_handle, mem);
- if(err) {
- printf("cpms query is fail Error : %d\n", err);
- return -1;
- } else {
- printf("cpms query is success : %s\n", mem);
- }
-
- return 0;
-}
-
-
-int lynq_get_smsc_address(char *serviceNumber)
-{
- char csca[128] = {0};
- if(info_handle == NULL || serviceNumber == NULL)
- {
- return -1;
- }
-
- int err = mbtk_sms_csca_get(info_handle, serviceNumber);
- if(err) {
- printf("lynq_get_smsc_address Error : %d\n", err);
- return err;
- } else {
- printf("lynq_get_smsc_address success\n");
- }
-
- return 0;
-}
-
-
-int lynq_set_smsc_address(const char* service_num)
-{
- if(info_handle == NULL || service_num == NULL)
- {
- return -1;
- }
-
- int err = mbtk_sms_csca_set(info_handle, service_num);
- if(err) {
- printf("Error : %d\n", err);
- return err;
- } else {
- printf("lynq_set_smsc_address success\n");
- }
- return 0;
-}
-
-
-
-
-
diff --git a/mbtk/lynq_lib/src/lynq_time.c b/mbtk/lynq_lib/src/lynq_time.c
new file mode 100755
index 0000000..ce3d3ec
--- /dev/null
+++ b/mbtk/lynq_lib/src/lynq_time.c
@@ -0,0 +1,58 @@
+#include "lynq_systime.h"
+#include "mbtk_type.h"
+
+int ntp_sync_time(int enable)
+{
+ UNUSED(enable);
+
+ return 0;
+}
+
+int modem_time_enable(int enable)
+{
+ UNUSED(enable);
+
+ return 0;
+}
+
+int gnss_time_enable(int enable)
+{
+ UNUSED(enable);
+
+ return 0;
+}
+
+int user_set_time(char* date, char* time)
+{
+ UNUSED(date);
+ UNUSED(time);
+
+ return 0;
+}
+
+int lynq_sync_time_from_rtc(void)
+{
+
+ return 0;
+}
+
+int lynq_get_time_src_status (time_src_status_s * time_src)
+{
+ UNUSED(time_src);
+
+ return 0;
+}
+
+int lynq_set_rtc_time(void)
+{
+
+ return 0;
+}
+
+int lynq_get_rtc_time(unsigned long *ulsec)
+{
+ UNUSED(ulsec);
+
+ return 0;
+}
+
diff --git a/mbtk/lynq_lib/src/lynq_voice_call.c b/mbtk/lynq_lib/src/lynq_voice_call.c
new file mode 100755
index 0000000..8c891d4
--- /dev/null
+++ b/mbtk/lynq_lib/src/lynq_voice_call.c
Binary files differ