FRDM-K64F, Avnet M14A2A, Grove Shield, to create smart home system. In use with AT&Ts M2x & Flow.

Dependencies:   mbed FXOS8700CQ MODSERIAL

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers wnc_control.h Source File

wnc_control.h

00001 /* ===================================================================
00002 Copyright © 2016, AVNET Inc.  
00003 
00004 Licensed under the Apache License, Version 2.0 (the "License"); 
00005 you may not use this file except in compliance with the License.
00006 You may obtain a copy of the License at
00007 
00008    http://www.apache.org/licenses/LICENSE-2.0
00009 
00010 Unless required by applicable law or agreed to in writing, 
00011 software distributed under the License is distributed on an 
00012 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 
00013 either express or implied. See the License for the specific 
00014 language governing permissions and limitations under the License.
00015 
00016 ======================================================================== */
00017 
00018 #ifndef __WNC_CONTROL_H_
00019 #define __WNC_CONTROL_H_
00020 
00021 static const unsigned WNC_TIMEOUT_MS = 10000;
00022 
00023 // Core function that sends data to the WNC UART
00024 extern int send_wnc_cmd(const char * s, string ** r, int ms_timeout);
00025 
00026 // Low level command functions
00027 extern void at_init_wnc(bool hardReset = false);
00028 extern void at_sockopen_wnc(const string & ipStr, const char * port );
00029 extern void at_sockclose_wnc(void);
00030 extern int at_dnsresolve_wnc(const char * s, string * ipStr);
00031 extern void at_sockwrite_wnc(const char * s);
00032 extern unsigned at_sockread_wnc(string * pS, unsigned n, unsigned retries);
00033 extern void at_at_wnc(void);
00034 extern int at_send_wnc_cmd(const char * s, string ** r, int ms_timeout);
00035 extern int check_wnc_ready(void);
00036 
00037 // High level functions that attempt to correct for things going bad with the WNC
00038 extern void software_init_mdm(void);
00039 extern void resolve_mdm(void);
00040 extern void sockopen_mdm(void);
00041 extern void sockwrite_mdm(const char * s);
00042 extern unsigned sockread_mdm(string * sockData, int len, int retries);
00043 extern void sockclose_mdm(void);
00044 extern void display_modem_firmware_version(void);
00045 
00046 #endif
00047 
00048