monoZ docs
MZ_modem_config.c
Go to the documentation of this file.
1/*
2 * MZ_modem_config.c
3 *
4 * Created on: Jun 29, 2021
5 * Author: MZ_click
6 */
7
8#include "MZ_timer.h"
10
11#if(MZ_SDK_ADVANCE_AT_INJECT == 1)
12
13// Please refer the Advance documentation.
14
15#else
16
17#define NIDD (1)
18#define IP (0)
19#define MODE (IP)
20
22{
25 (void)mz_raw_at_exe_at();
27 (void)mz_raw_at_write_SETACFG("pm","conf","sleep_mode","disable");
28 (void)mz_raw_at_write_SETACFG("modem_apps","Mode","AutoConnectMode","true");
29 (void)mz_raw_at_write_cpsms(0,"","","","");
30 (void)mz_raw_at_write_cedrxs(0,0,"");
31#if (MODE == IP)
32 (void)mz_raw_at_write_DEVCFG("\"WR\"", "\"DDMODE\"", "\"IP\"");
34 (void)mz_raw_at_exe_z();
36 (void)mz_raw_at_write_SETACFG("radiom","config","preferred_rat_list","CATM");
38 (void)mz_raw_at_exe_z();
40#else //(MODE == NIDD)
41 (void)mz_raw_at_write_DEVCFG("\"WR\"", "\"DDMODE\"", "\"NIDD\"");
43 (void)mz_raw_at_exe_z();
45 (void)mz_raw_at_write_SETACFG("radiom","config","preferred_rat_list","NBIOT");
46#endif
47}
48
49#if (MODE == IP)
50void mz_apn_set(void)
51{
52 (void)mz_raw_at_write_SETACFG("APNTable","Class1","Name","\"mtc.gen\"");
53 (void)mz_raw_at_write_SETACFG("APNTable","Class1","IP_Type","\"IPV4V6\"");
54 (void)mz_raw_at_write_SETACFG("APNTable","Class1","AuthType","\"CHAP\"");
55 (void)mz_raw_at_write_SETACFG("APNTable","Class1","AuthName","\"mtc\"");
56 (void)mz_raw_at_write_SETACFG("APNTable","Class1","AuthPwd","\"mtc\"");
57 (void)mz_raw_at_write_SETACFG("APNTable","Class1","Enabled","\"true\"");
59 (void)mz_raw_at_write_PDNSET(1,"\"mtc.gen\"","\"IPV4V6\"");
60}
61#endif
62
64{
65#if (MODE == IP)
67 (void)mz_raw_at_write_SETACFG("LWM2M","Config","NameMode","0");
68 (void)mz_raw_at_write_SETACFG("LWM2M","Config","Name","\"cdftls02029395176\"");
69 (void)mz_raw_at_write_SETACFG("LWM2M","HostObjects","HostResponseTimeout","15000");
70 (void)mz_raw_at_write_SETACFG("LWM2M","Config","SupportedObjects","\"0;1;3;4;5;7;19\"");
71 (void)mz_raw_at_write_SETACFG("lwm2m_dir/instances_info","19","instances","0;1");
72 (void)mz_raw_at_write_TESTCFG("\"lwm2m_server\"","\"coaps://device-lw-0.iotpf-basic.mb.softbank.jp:5684\"","\"DM_SEC\"","\"cdftls02029395176\"","\"password\"");
73#else //(MODE == NIDD)
74 (void)mz_raw_at_write_SETACFG("LWM2M","HostObjects","HostResponseTimeout","15000");
75 (void)mz_raw_at_write_SETACFG("LWM2M","Config","ConfirmNotify","1");
76 (void)mz_raw_at_write_SETACFG("LWM2M","Config","SupportedObjects","\"0;1;3;4;5;7;19\"");
77 (void)mz_raw_at_write_SETACFG("LWM2M","Config","NameMode","0");
78 (void)mz_raw_at_write_SETACFG("lwm2m_dir/instances_info","19","instances","0;1");
79 (void)mz_raw_at_write_SETACFG("LWM2M","Config","Name","\"imei_356766100976410_OMRON\"");
80 (void)mz_raw_at_write_LWM2MCMD("\"set_resource\"",0,10,0,0,"\"coap://nidd.lwm2m:5683\"");
81 (void)mz_raw_at_write_LWM2MCMD("\"set_resource\"",0,10,1,0,"false");
82 (void)mz_raw_at_write_LWM2MCMD("\"set_resource\"",0,10,2,0,"3");
83 (void)mz_raw_at_write_LWM2MCMD("\"set_resource\"",1,10,1,0,"604800");
84 (void)mz_raw_at_write_LWM2MCMD("\"set_resource\"",1,10,7,0,"N");
85 (void)mz_raw_at_write_SETACFG("LWM2M","TransportBindings_1_1","Queue","false");
86#endif
87}
88
90{
92 (void)mz_raw_at_exe_z();
94 (void)mz_raw_at_exe_at();
95}
96
98{
99 (void)mz_raw_at_exe_at();
100 (void)mz_raw_at_exe_e1();
101 (void)mz_raw_at_exe_cimi();
102 (void)mz_raw_at_exe_cnum();
103 (void)mz_raw_at_exe_cgmi();
104 (void)mz_raw_at_exe_cgsn();
105 (void)mz_raw_at_read_cfun();
106 (void)mz_raw_at_read_cereg();
108 (void)mz_raw_at_read_cops();
109 (void)mz_raw_at_read_cclk();
110}
111
113{
115 (void)mz_raw_at_write_LWM2MOPEV(1,100);
119 (void)mz_raw_at_write_LWM2MCMD("\"SERVERSINFO\"",0,0,0,0,"");
120}
121
122void mz_reset_sequence(void * arg)
123{
124 (void)arg;
126#if (MODE == IP)
127 mz_apn_set();
128#endif
133}
134
135void mz_reboot_sequence(void * arg)
136{
137 (void)arg;
141}
142
143#endif //(MZ_SDK_ADVANCE_AT_INJECT == 1)
monoZ Murata AT Include
void mz_reset_sequence(void *arg)
void mz_power_config(void)
void mz_device_start(void)
void mz_device_reboot(void)
void mz_reboot_sequence(void *arg)
This is the function prototype used for sending AT cmds used in server re-registration.
void mz_lwm2m_start(void)
void mz_lwm2m_config(void)
void mz_apn_set(void)
This file contains APIs for create,delete,start and stop of timers. Maximum 5 timers can be created....
#define AT_TIME_20SEC
Define 20 Second AT command Time.
Definition: MZ_timer.h:23
#define AT_TIME_15SEC
Define 15 Second AT command Time.
Definition: MZ_timer.h:22
#define AT_TIME_5SEC
Define 5 Second AT command Time.
Definition: MZ_timer.h:20
#define AT_TIME_2MIN
Define 2 Min AT command Time.
Definition: MZ_timer.h:27
#define AT_TIME_10SEC
Define 10 Second AT command Time.
Definition: MZ_timer.h:21
mz_error_t mz_raw_at_exe_at(void)
This function create and schedule EXECUTE AT command.
mz_error_t mz_raw_at_read_cops(void)
This function create and schedule READ AT command for COPS.
void mz_create_cmd_time_wait_before_next(mzInt32 _twn)
This function sets the wait time before next AT command.
mz_error_t mz_raw_at_read_cclk(void)
This function create and schedule READ AT command for CCLK.
mz_error_t mz_raw_at_write_TESTCFG(char *test_mode, char *param1, char *param2, char *param3, char *param4)
This function create and schedule WRITE AT command for %TESTCFG.
mz_error_t mz_raw_at_exe_e1(void)
This function create and schedule EXECUTE AT command for E1.
void mz_create_cmd_timeout(mzInt32 _to)
This function sets the AT command timeout for each AT command execution.
mz_error_t mz_raw_at_read_cfun(void)
This function create and schedule TEST AT command for +CFUN.
mz_error_t mz_raw_at_exe_cgmi(void)
This function create and schedule EXECUTE AT command for +CGMI.
mz_error_t mz_raw_at_write_LWM2MOBJCMD(mzUint8 mode)
This function create and schedule WRITE AT command for %LWM2MOBJCMD.
mz_error_t mz_raw_at_write_DEVCFG(char *cmd, char *object, char *value1)
This function create and schedule WRITE AT command for %DEVCFG.
mz_error_t mz_raw_at_exe_cimi(void)
This function create and schedule EXECUTE AT command for +CIMI.
mz_error_t mz_raw_at_exe_cgsn(void)
This function create and schedule EXECUTE AT command for +CGSN.
mz_error_t mz_raw_at_exe_cnum(void)
This function create and schedule EXECUTE AT command for +CNUM.
mz_error_t mz_raw_at_write_LWM2MCMD(char *str1, mzUint8 val1, mzUint8 val2, mzUint8 val3, mzUint8 val4, char *val5)
This function create and schedule WRITE AT command for %LWM2MCMD.
mz_error_t mz_raw_at_read_cereg(void)
This function create and schedule READ AT command for +CEREG.
mz_error_t mz_raw_at_write_SETACFG(char *param_file_name, char *param_section, char *param_name, char *param_value)
This function create and schedule WRITE AT command for %SETACFG.
mz_error_t mz_raw_at_write_PDNSET(char ext_session_id, char *apnname, char *ip_type)
This function create and schedule WRITE AT command for %PDNSET.
mz_error_t mz_raw_at_exe_z(void)
This function create and schedule EXECUTE AT command for Z.
mz_error_t mz_raw_at_write_LWM2MOPEV(mzUint8 event, mzUint8 mode)
This function create and schedule WRITE AT command for %LWM2MOPEV.
mz_error_t mz_raw_at_write_cedrxs(mzUint8 mode, mzUint8 actiontype, char *ReDRXv)
This function create and schedule WRITE AT command for +CMGD.
mz_error_t mz_raw_at_write_cpsms(mzUint8 mode, char *RPRAU, char *RGRT, char *RPTAU, char *RAT)
This function create and schedule WRITE AT command for +CPSMS.