Atop SE59XX-SDK User Manual Download Page 58

SE59XX-SDK 
Software development Kit

 

User Manual 

V1.2 

 

Data Structure Documentation 

 

7.1

 

sessiontag Struct Reference 

 

7.1.1

 

data fields 

 
The documentation for this struct was generated from the following file: 
atop_application/utils/atop_tcp_server/atop_tcp_server.c 
 

 

pthread_t thandler 

 

int 

tid

 

 

int 

uartfd

 

 

int 

serv_sockfd

 

 

int 

serv_acceptsockfd

 

 

struct 

sockaddr_in serv_addr

 

 

struct 

sockaddr_in client_addr

 

 

int 

serv_link_state

 

 

int 

serv_socket_init

 

 

int 

err_count

 

 

7.2

 

Network APIs 

 
#include <stdio.h> 
#include <fcntl.h> 
#include <unistd.h> 
#include <string.h> 
#include <sys/socket.h> 
#include <netinet/in.h> 
#include <arpa/inet.h> 
#include "atop_common.h" 
#include "atop_eeprom.h" 
#include "mobile.h" 
 

7.2.1

 

Functions 

 
void AtopSDKSetNetIP (int eth, char *ip) 

AtopSDKSetNetIP  

Sets the device’s network IP on the selected Ethernet port 

void AtopSDKSetNetMask (int eth, char *mask) 

AtopSDKSetNetMask 

Sets the device’s subnet mask on the selected Ethernet port 

Summary of Contents for SE59XX-SDK

Page 1: ...SE59XX SDK Software development Kit User Manual V1 2 SE59XX SDK Family Software Development Kit User Manual V1 2 May 3rd 2018 Atop Technologies Inc...

Page 2: ...tion For example click on any item listed in the Table of Contents to go to that page General Description User Guide Published by Atop Technologies Inc 2F No 146 Sec 1 Tung Hsing Rd 30261 Chupei City...

Page 3: ...ng rights created by patent grant or registration of a utility model or design are reserved Disclaimer We have checked the contents of this manual for agreement with the hardware and the software desc...

Page 4: ...8 1 Using TFTP protocol 22 2 8 2 Using FTP protocol 22 2 9 Login or Remote Login to the device 23 2 9 1 Remote Login 23 2 9 2 Use a debug command line to Login 23 2 10 Automatic execution on Startup o...

Page 5: ...Software API Reference 57 6 1 File List 57 7 Data Structure Documentation 58 7 1 sessiontag Struct Reference 58 7 1 1 data fields 58 7 2 Network APIs 58 7 2 1 Functions 58 7 3 Network APIs Function do...

Page 6: ...0 1 Functions 66 7 10 2 int AtopGetDI int index 67 7 11 Write Digital Output API documentation 67 7 11 1 Functions 67 7 11 2 int AtopSetDO int index int value 67 7 12 Hardware Watchdog API documentati...

Page 7: ...FTP Download with FileZilla 22 Figure 2 16 Command line Login 23 Figure 3 1 DB9 Pin Number 38 Figure 3 2 TB5 Pin Number 38 Figure 3 3 DB9 Pin Number 39 Figure 3 4 Terminal Block TB 5 Pin Number 39 Fig...

Page 8: ...16A Pin Assignment for 5 Pin Terminal Block to RS 232 RS 422 RS 485 Connectors 42 Table 4 1 Sample programs for COM port interface 44 Table 4 2 SE59XX device node 44 Table 4 3 SE59XX Programming comma...

Page 9: ...mmers network personnel or support technicians who are familiar with network operations and C Language programming For any related problems please contact your local distributor If they are unable to...

Page 10: ...tions providing multiple sample SDK programs to hardware devices 2 ATOP utility providing firmware upgrade network settings and storage mounting tools 3 Third party providing 3rd parties software requ...

Page 11: ...SE59XX SDK Software development Kit User Manual V1 2...

Page 12: ...mp 6utility for arbitrary precision arithmetic Hostap user space daemon for access point and authentication servers i2c tools 3 1 2 I2C tools to manage I2C Bus iniparser Ini file parser library iptabl...

Page 13: ...SE59XX SDK Software development Kit User Manual V1 2 libatop so 1 0 0 ATOP library binary...

Page 14: ...ed to modify under this folder rootfs tar bz2 Pre build root file system The foll o wings are the list of ap plication p rogra ms in build folder Table 2 4 Content of build folder Folder Name Descript...

Page 15: ...al and a CAT5E Ethernet cable Then follow below figure to connect the Debug port to PC s COM and CAT5E cable to connect to the Device s LAN1 Ethernet port to any Host PC s Ethernet port Figure 2 2 Con...

Page 16: ...server in Windows An open source version is available for download and can be found as tftpd32 Screenshot below shows tftpd32 exe after running the application Figure 2 4 TF PD32ap pearanceafter exec...

Page 17: ...SE59XX SDK Software development Kit User Manual V1 2 Figure 2 5 SE5904DB o ot loadermenu...

Page 18: ...e 2 7 Figure 2 6LAN Set tings Figure 2 7 LAN1 settings Enter 0 to exit to upper layer menu and select 5 to enter the TFTP Download menu then select 1 to setup TFTP server IP as Figure 2 8 Figure 2 8 T...

Page 19: ...de the same LAN Atop Management Utility will scan the whole network automatically Figure 2 9 SE59XX connection scheme example on SE5904D Now please power on the device and run Atop s Device Management...

Page 20: ...are version 1 Useadebuglineas per Paragraph 2 3 1ab ove toc onnect c ons ole portof the device Afte r bo otup ty pe atop_sho w_ver in the c onsole c o m m a nd line to check current version as Figure...

Page 21: ...ARCH ar m ex port PATH opt ti a m335x linux devkit 08 00 00 00 bin PATH ex port CROSS_COMP ILE ar m linux gnueabihf 2 6 Compiling Procedure for Atop Applications Toc o mpile ATOP ap plication in SDK...

Page 22: ...P Re me m ber touse ch m o d c o m m a nd tom o dify the ac cess att ributesof these files I f t rans mission failed pleasecheck the netw orkingc onnection 2 8 2 Using FTP protocol Setup or read FTP a...

Page 23: ...uas Figure1 16 2 Use any to ols sup porting the telnet p rotoc olsuchas ssh insideofWind o ws 3 Enter SE59XX_TARGET_IP via sshusing software put ty 4 L oginac c o unt as firs t ste p sh o wn 2 9 2 Use...

Page 24: ...PT nonaliasing data cache VIPT aliasing instruction cache 0 000000 Machine model TI AM335x EVM 0 000000 cma CMA reserved 16 MiB at 9e800000 0 000000 Memory policy Data cache writeback 0 000000 CPU All...

Page 25: ...eferral 0 110401 No ATAGs 0 110420 hw breakpoint debug architecture 0x4 unsupported 0 127584 bio create slab bio 0 at 0 0 141124 edma dma engine edma dma engine 0 TI EDMA DMA engine driver 0 142127 li...

Page 26: ...uto musb_init_controller failed with status 517 1 188587 platform musb hdrc 0 auto Driver musb hdrc requests probe deferral 1 196932 47401b00 usb phy supply vcc not found using dummy regulator 1 20628...

Page 27: ...83214 cpsw 4a100000 ethernet Missing dual_emac_res_vlan in DT 1 890000 cpsw 4a100000 ethernet Using 1 as Reserved VLAN for 0 slave 1 897074 cpsw 4a100000 ethernet Missing dual_emac_res_vlan in DT 1 90...

Page 28: ...device eth1 net ipv6 conf eth1 accept_ra 1 Starting atop_ntp sh OK Starting dropbear sshd OK Starting ProFTPD 7 332967 warning proftpd uses 32 bit capabilities legacy support in use done Starting stun...

Page 29: ...Terminal Block SE5904D TB5 x 8 5 pin 5 08mm lockable Terminal Block SE5908A TB5 x 16 5 pin 5 08mm lockable Terminal Block SE5916A Documentation 1 Hardware Installation Guide Warranty card is included...

Page 30: ...550m 3 3V 20 85 C LM38 C3S TI N SFP Transceiver 1250Mbps 1310nmFP Multi mode 2km 3 3V 40 85 C LS38 C3S TI N SFP Transceiver 1250Mbps 1310nmFP Single mode 10km 3 3V 40 85 C LS38 C3L TI N SFP Transceive...

Page 31: ...rial Interface RS 232 RS 422 RS 485 Software Selectable Default RS 232 The first port available on SE5901B is RS 232 RS 485 The second port available on SE5901B IO X is only RS 232 The isolation versi...

Page 32: ...SE5908A SE5916A Max 7 2W SE5901B EMI EMC FCC Part 15 Subpart B Class A EN 55032 Class B EN 61000 6 2 Class B EN 61000 3 2 EN 61000 3 3 EN 55024 EN 61000 6 4 IEC 61850 3 IEEE 1613 SE5908A and SE5916A...

Page 33: ...SE59XX SDK Software development Kit User Manual V1 2...

Page 34: ...SE59XX SDK Software development Kit User Manual V1 2 3 4 External Device s Overview The following figures show particular SE59XX series device s front and rear panels SE5901 SE5904D...

Page 35: ...SE59XX SDK Software development Kit User Manual V1 2 SE5901B SE5908 16...

Page 36: ...SE59XX SDK Software development Kit User Manual V1 2 SE5908A 16A...

Page 37: ...SE59XX SDK Software development Kit User Manual V1 2...

Page 38: ...RS 485 Half Duplex 1 DCD N A N A 2 RxD TXD N A 3 TxD RXD Data 4 DTR N A N A 5 SG Signal Ground SG Signal Ground SG Signal Ground 6 DSR N A N A 7 RTS RXD Data 8 CTS TXD N A 9 RI N A N A 1 x 5 pin Male...

Page 39: ...Full Duplex RS 485 Half Duplex 1 DCD N A N A 2 RxD TxD Data 3 TxD RxD N A 4 DTR N A N A 5 SG Signal Ground SG Signal Ground SG Signal Ground 6 DSR N A N A 7 RTS RxD N A 8 CTS TxD Data 9 RI N A N A 5 P...

Page 40: ...SE59XX SDK Software development Kit User Manual V1 2 3 TxD RxD N A 4 RTS RxD N A 5 SG Signal Ground SG Signal Ground SG Signal Ground...

Page 41: ...B for RS 232 485 COM 1 RS 232 COM 2 Relay and DI pin assignment Pin DI and Relay COM1 RS 232 COM1 RS 485 COM2 RS 232 1 DI1 Dedicated for DI DO Dedicated for DI DO Dedicated for DI DO 2 DI2 Dedicated f...

Page 42: ...S 232 RS422 RS 485 Connectors Pin RS 232 RS 422 RS 485 1 2 RxD TxD Data 3 TxD RxD 4 5 SG Signal Ground SG Signal Ground SG Signal Ground 6 7 RTS RxD 8 CTS TxD Data 9 5 Pin Terminal Block to RS 232 RS...

Page 43: ...SE59XX SDK Software development Kit User Manual V1 2 5 SG Signal Ground SG Signal Ground SG Signal Ground...

Page 44: ...ter facewith the kernel M axi m u mba ud rate 92 160 0 Mini m u m ba ud rate 300 Serial interface sup ported RS232 RS485 RS422 The sa mple p rogra mis in the software atop_ap plication utils atop_lo o...

Page 45: ...p p edwith Netw ork ports The sa mple p rogra min the folder software atop_ap plication utils atop_tcpserver describes ho wtouse COM ports inco m binationwith T C P server c onnections Table 4 5 Sampl...

Page 46: ...le program to use the device s Digital Inputs 4 3 3 Digital Outputs There are 2 DigitalOut putson SE590 1 B IO The sa mple p rogra mis available in the software atop_ap plication utils atop_sdk folder...

Page 47: ...uton o m o uslyunderstand if the syste miscrashing forwhatever reason During a Syste mcrash the OSw on t reset the I C within the deadline and therefore the syste mwillauto m atically rebo ot All SE59...

Page 48: ...nnect c A sample program to connect to 3G 4G atop_4G_DialOnB o ot c A sample program to set the device to dial on boot atop_4G_PinDisable c A sample program to disable the SIM PIN atop_4G_PinEnable c...

Page 49: ...loopback under the kernel shell Be sure that you have connect the testing COM ports connected Be sure to make TXD RXD pins connected rs232_loopback rs422_loopback rs485_loopback The baud rate is set a...

Page 50: ...ack test 4 Select the TCP_Server mode and input IP address and TCP port number for COM1 5 Click Connect to make TCP connections The data keyed in Send box will be sent through the COM port Send Loop i...

Page 51: ...r Table 5 1 TCP port to COM port mapping COM port TCP port COM 1 4660 COM 2 4661 COM 3 4662 COM 4 4663 COM 16 4660 16 1 5 2 Test Buzzer interface Upload the test file buzzer from software atop_applica...

Page 52: ...SE59XX SDK Software development Kit User Manual V1 2...

Page 53: ...er into jffs2 and execute the following command on the kernel shell do_test Youcanusem ulti meter tocheck the DO0 1turnon5 sec then turnoff 5 5 Test Hardware Relay Output Use test to ol relay to test...

Page 54: ...UNLed turnonoroff Use test to ol alar m Led to test HWalar mLED alar m Ledon alar m Ledoff You should see the ALARM Red Led turn on or off 5 9 Test RTC interface Upload test file rtc from software ato...

Page 55: ...mand on the kernel shell syste m 2rtc I t will p rocessc o m m a nd h w cl o ck w f dev rtc 1 syste m 2rtc set hardwarecl o ck fro msyste mti me Inorder tom ake sure thecl o c kwas set c orrectly turn...

Page 56: ...t atop cafile jffs2 mosquitto org crt mosquitto_pub h test mosquitto org p 8883 t atop cafile mosquitto org crt d m test MQTT with username and password example m o squitto_sub h192 168 4 238 uatop P...

Page 57: ...re is a list of all documented files with brief descriptions atop_application utils atop_libsdk network c Network APIs atop_application utils atop_libsdk system c EEPROM User Name and Password setting...

Page 58: ...r_in serv_addr struct sockaddr_in client_addr int serv_link_state int serv_socket_init int err_count 7 2 Network APIs include stdio h include fcntl h include unistd h include string h include sys sock...

Page 59: ...the device s cellular Access Point SE5901B only void AtopSDKSet4GPinEnable char pinCode AtopSDKSet4GPinEnable Sets the SIM card s PIN code SE5901B only void AtopSDKSet4GPinDisable void AtopSDKSet4GPi...

Page 60: ...opSDKSet4GApn char apn API AtopSDKSet4GApn Arguments apn char string of APN access point name Function writes APN string to Module ini file Returns nothing void Example code 145 146 set_apn_info uint8...

Page 61: ...module SIM PIN check Returns nothing void Example code 176 177 set_pin_enable 0 178 7 3 7 void AtopSDKSet4GPinEnable char pinCode API AtopSDKSet4GPinEnable Arguments new PIN code char Function writes...

Page 62: ...gs to EEPROM Returns nothing void Example code 88 89 struct in_addr inp 90 char info 16 91 92 sprintf info dN eth 93 94 if inet_aton gw inp 0 95 AtopEESetLanGateway info inet_ntoa inp 96 7 3 11 void A...

Page 63: ...f info dN eth 71 72 if inet_aton mask inp 0 73 AtopEESetLanNetmask info inet_ntoa inp 74 7 4 EEPROM User Name and Password Settings APIs atop_application utils atop_libsdk system c File Reference incl...

Page 64: ...31 32 AtopEESetSysUserName info name 33 7 5 2 void AtopSDKSetUserPassword int password API AtopSDKSetUserPassword Arguments password char Function writes new password to the EEPROM Returns nothing vo...

Page 65: ...h File Reference 7 7 1 Functions void AtopSetAlarmLed u32 value AtopSetAlarmLed Turns the Alarm LED Off and On 7 7 2 void AtopSetAlarmLed u32 value API AtopSetAlarmLed Arguments value on or off u32 0...

Page 66: ...opBuzzerOnOff int value AtopBuzzerOnOff Starts or stops the buzzer 7 9 2 Macros define BUZZER_OFF 0 define BUZZER_ON 1 7 9 3 void AtopBuzzerOnOff int value API AtopBuzzerOnOff Arguments value whether...

Page 67: ...nt value AtopSetDO Writes to Digital Output channel index the value 7 11 2 int AtopSetDO int index int value API AtopSetDO Arguments index defines the number of Digital Output selected for control val...

Page 68: ...void API atop_hwd_clear Arguments nothing void Function kicks hardware watchdog timer reset Returns nothing void 7 12 4 void atop_hwd_disable void API atop_hwd_disable Arguments nothing void Function...

Page 69: ...ssid char ssid get_ssid reads the current SSID from the INI file and saves to ssid Int set_ssid char ssid_name set_ssid sets new SSID to the INI file Int get_key_mgmt char key_mgmt get_key_mgmt reads...

Page 70: ...the INI configuration file Returns Error code int 1 ERROR Cannot open file cannot read key management from file 0 Successful Example code 86 87 char str 88 89 read key from ini 90 dictionary ini inipa...

Page 71: ...7 178 179 free dictionary space 180 iniparser_freedict ini 181 return 0 182 7 13 5 int get_ssid char ssid API get_ssid Arguments ssid buffer for reading SSID string Function reads SSID from ini file R...

Page 72: ..._name w 244 fprintf fout network n 245 fprintf fout tscan_ssid 1 n 246 if ssid NULL fprintf fout tssid s n ssid 247 if psk NULL strcmp key_mgmt None 0 fprintf fout tpsk s n psk 248 if key_mgmt NULL fp...

Page 73: ...open jffs2 tmpFile w 146 iniparser_dump_ini ini fin 147 iniparser_freedict ini 148 149 fclose fin 150 remove ini_file_name 151 rename jffs2 tmpFile ini_file_name 152 return 0 153 7 13 9 int set_psk ch...

Page 74: ...d_name string of SSID char Function writes SSID to ini file Returns int 1 error SSID length problem or cannot open file 0 successful Example code 55 56 read key from ini 57 dictionary ini iniparser_lo...

Page 75: ...d No 22 Kensington Terrace Kensington Rd Bangalore 560008 India Tel 91 80 4920 6363 E mail Abhishek S atop in ATOP INDONESIA BRANCH Jopson Li Branch Director Wisma Lampung Jl No 40 Tomang Raya Jakarta...

Reviews: