background image

 

7 Teleservice Application Framework 

 

 

User Manual 

266/374 

 

 

7.3.12.26  utils_get_time_ms 

Funcon Description 

uint32

 

utils_get_time_ms (void)

 

The function returns the current time that is elapsed since the TC1 was initialized. 

The elapsed time is scaled in milliseconds. 

Information Flow 

Output Information 

Return Value 

Description 

uint32 

Up time in milliseconds  

  

 

7.3.12.27  utils_open_dir 

Function Description 

void* utils_open_dir(const charn* const opcn_Path)

 

  

The function opens a directory for reading. 

  

Information Flow 

Input Information 

Parameter 

Range 

Description 

opcn_Path 

 

Directory path 

  

Output Information 

Return Value 

Description 

!= NULL 

Directory handle 

NULL  

Failed to open a directory 

  

 

Summary of Contents for TC1

Page 1: ...TC1 User Manual Version of this document V1 00r0 ...

Page 2: ...ace 20 4 6 Power up Device 21 4 7 How to Secure the System 22 5 Hardware 23 5 1 Variants 23 5 2 Technical Data 24 5 2 1 Block Diagram Variant TC1 WiFi 24 5 2 2 Block Diagram Variant TC1 WIFI 25 5 2 3 Block Diagram Variant TC1 Mobile 26 5 2 4 Power Supply 26 5 2 5 Processor and System Memory 27 5 2 6 Communication Interfaces 27 5 2 7 Inputs and Outputs 28 5 2 8 System Data 29 5 3 Pin Assignment 30 ...

Page 3: ... 7 2 3 Logger daemon 93 7 2 4 GPS daemon 96 7 2 5 SMS daemon 98 7 2 6 Network daemon 100 7 2 7 Server daemon 105 7 2 8 Signal daemon 109 7 2 9 Mail daemon 115 7 3 TAF Library 124 7 3 1 Introduction 124 7 3 2 Notation 126 7 3 3 D Bus Utils 133 7 3 4 System 151 7 3 5 Datapool 158 7 3 6 Datalogger 189 7 3 7 GPS 229 7 3 8 SMS 232 7 3 9 Network 236 7 3 10 Server 241 7 3 11 Signal 248 7 3 12 Utils 252 8...

Page 4: ...dows 296 8 3 3 Examples 305 8 3 4 Libraries 306 9 Update the Device 307 9 1 BSP Components 307 9 2 Windows Updater 308 9 3 Linux Updater 310 10 Application Notes 314 10 1 Communication Interfaces 314 10 1 1 Setting up the Serial Interface 314 10 1 2 TFTP 315 10 1 3 NFS 315 10 1 4 Telnet 317 10 1 5 I O Pin s 318 10 1 6 GSM 319 10 1 7 CAN 320 10 1 8 Bluetooth M2M 321 10 1 9 E Mail 325 ...

Page 5: ...0 kefex_client STW KEFEX console client 335 11 11 Lighttpd Webserver 338 12 Open Source Licenses 340 12 1 Linux Kernel License 340 12 2 U Boot License 345 12 3 busybox License 350 12 4 uClibc License 355 13 Qualification Tests 363 13 1 Compliance Information 363 13 2 Electrical Safety 363 13 3 Electromagnetic Compatibility e1 E1 366 13 4 Electromagnetic Compatibility CE 367 13 5 EMC Radio and Tele...

Page 6: ...addr Bluetooth Address BIOS Basic Input Output System BLOB Binary Large Objects BSP Board Support Package BT Bluetooth CAN Controller Area Network CANopen Controller Area Network open protocol CBC MAC cipher block chaining message authentication code cc Carbin Copy e mail CCMP Counter Mode CBC MAC Protocol CEST Central European Summer Time cmd Command COF coefficient of friction COL2 CANopen Layer...

Page 7: ...ll computer networks DPL Data Pool List DSL Digital Subscriber Line DSUB D sub miniature connector design EDR enhanced data rate EEPROM electrically erasable programmable read only memory EGNOS European Geostationary Navigation Overlay Service SBAS EIRP equivalent isotropically radiated power EOF End of File ETH Ethernet FBE Free Buffer Enquiry FDT Flattened Device Tree FIT Flattened Image Tree FP...

Page 8: ...ugger GNSS Global Navigation Satellite System GNU GNU s Not Unix recursive acronym Free Software GPL GNU General Public License GPO Group Policy object GPRS General Packet Radio Service GPS Global Positioning System GSM Groupe Spécial Mobile Global System for Mobile Communications GUI graphical user interface HCI Host Controller Interface HSPA High Speed Packet Access extension for UMTS HTTP Hyper...

Page 9: ...ormat LFJNAME Log File Job Name LGPL Lesser General Public License GNU LTS Long Term Support UBUNTU Linux M2M Machine to Machine MAC Media Access Control MCC Mobile Country Code MDT Memory Technology Device Subsystem for Linux mmc Microsoft Management Console Certificates MNC Mobile Network Code MOT Motion Sensor wake up signal MSAS Multi functional Satellite Augmentation System japanese SBAS mtd ...

Page 10: ...rmation exchange certificates pid Process Identifier PIN Personal Identification Number ppc Power PC PPP Point to Point Protocol pppd PPP Dial PSCAN Page Scan Flag Bluetooth device accepts connection requests PSK Pre Shared Key QZSS Quasi Zenith Satellite System japanese SBAS RAM random access memory RFCOMM Radio Frequency Communication ROM read only memory rootfs Root File System RTC Real Time Cl...

Page 11: ...ux folder srv Service Linux folder ssh secure shell SSID Service Set Identifier ssl Secure Sockets Layer stderr Standard Error Output Linux stdout Standard Output Linux SW Software TAF Teleservice Application Framework TCP Transmission Control Protocol TFTP Trivial File Transfer Protocol TFTPD Trivial File Transfer Protocol Daemon server TKIP Temporal Key Integrity Protocol tty Input and output de...

Page 12: ... Transformation Format VDI Virtual Box Disk Image VI visual text editor within Linux WAAS Wide Area Augmentation System SBAS WEP Wired Equivalent Privacy WLAN encryption WLAN Wireless Local Area Network WMM Wi Fi Multimedia WPA Wi Fi Protected Access WLAN encryption XML Extensible Markup Language XOR exclusive OR logic gate ...

Page 13: ...y The TC1 is available in three standard variants tuned to the respective use case with WiFi and Bluethooth or cellular communication or GNSS functionality Without unnecessary parts for the intended use case makes the TC1 a cost optimized on board module Cloud connectivity Prepared for connecting to STW s machines cloud platform storing of information regarding vehicle parameters settings and beha...

Page 14: ...e 240 Norcross GA 30071 Phone 770 242 1002 Fax 770 242 1006 Web www stw technic com http www stw technic com Email sales stw technic com mailto sales stw technic com UK Sensor Technik UK Ltd Unit 21M Bedford Heights Business Centre Manton Lane Bedford Bedfordshire MK41 7PH Phone 44 0 1234 270770 Fax 44 0 1234 348803 Web www sensor technik co uk http www sensor technik co uk Email nick d sensor tec...

Page 15: ... void if The warranty seals of STW have been removed or damaged The product was opened by unauthorized persons Damage has been caused as a result of use storage or installation that does not comply with the user manual 3 4 Documents Overview of documents that are available for the TC1 Document title Publisher Description TSP TC1 Release Notes STW Contains Release Notes of the communication driver ...

Page 16: ...anguage C and shell scripting Installation and usage of communication interfaces like CAN bus RS232 ETH WIFI GSM GPS and BT STW offers training courses for commissioning and programming the TC1 Please see the training catalog of our Academy on the homepage of STW www sensor technik de http www sensor technik de 3 6 Used Symbols and Formats The following symbols and formats are used in our manuals ...

Page 17: ...e unit shall be conform to the recycling regulations of the country and regions in which they are disposed Dispose the TC1 according to the valid local regulations 3 8 History Version Date Editor Changes link to changed data V1 00r0 11 01 2017 CKA Added chapter All chapters ...

Page 18: ...for TC1 33518 2 Power supply 5 V 15 V the TC1 needs at least 9 V DC 53711 3 Accessories kit for mating connector see Connector on page 35 48083 4 2 Insert SIM Card To be able to use the mobile feature of the TC1 a SIM card must be installed The TC1 can handle any kind of common network provider The SIM card slot is located inside the connector How to install a SIM card 1 Press the yellow button be...

Page 19: ...e Pin Assignment on page 30 for further information 2 Connect the development box to your computer Use a straight through cable with two 9 pins DSUB female connectors Connect one end of the RS232 cable with the RS232 1 connector of your development box Connect the other end of the cable to the COM1 port of your PC You can also use a USB to RS232 converter recommended converter from GIGAWARE 3 Conn...

Page 20: ...ed operating system on the used PC for development a RS232 terminal must be installed Recommended programs for a RS232 terminal GtkTerm for computers using a Linux operating system Tera Term for Windows desktop PCs GtkTerm used for RS232 terminal program Settings for the serial port Property Value Description Port state here your port Baud rate 115200 Data 8bit Parity none Stop 1 bit Flow control ...

Page 21: ...F the TC1 in case it was previously turned on Start your RS232 terminal in this case GTKTerm Turn power ON to TC1 Switch on UB and D on the front site of the development box On the RS232 terminal you can see the following U Boot messages System Login The default admin user is root without any password ...

Page 22: ...nd passwd and type in a password How to set up a firewall with iptables The TC1 can be secured with iptables iptables can be used to build internet firewalls iptables is the userspace command line program used to configure the packet filtering ruleset For further information go to https www netfilter org https www netfilter org ...

Page 23: ...ants Variants Details description TC1 WiFi WLAN and Bluetooth with external antenna IEEE 802 11 2 4 GHz 5 5 GHz a b g n Bluetooth 4 0 2 1 EDR BLE Power Class 1 5 TC1 WiFi WLAN Bluetooth and GNSS with two external antennas IEEE 802 11 2 4 GHz 5 5 GHz a b g n Bluetooth 4 0 2 1 EDR BLE Power Class 1 5 GPS GLONASS TC1 Mobile Cellular networks and GNSS with two external antennas 2G Quad Band GSM 850 90...

Page 24: ...5 Hardware User Manual 24 374 5 2 Technical Data The technical data provides an overview of all technical characteristics of the components of the TC1 5 2 1 Block Diagram Variant TC1 WiFi ...

Page 25: ...5 Hardware User Manual 25 374 5 2 2 Block Diagram Variant TC1 WIFI ...

Page 26: ...r Supply Component Description Range DC voltage supply Voltage at UB power supply 9 V 32 V DC Current consumption Stand by Sum of input currents at UB UKL15 0 V ignition off 1mA ECU active UB supply current UKL15 UKL15HIGH no external load 350 mA at UB 12 V DC 200 mA at UB 24 V DC ...

Page 27: ...les 25 C NAND Flash memory 1 GByte for data NOR Flash memory 64 MByte for program Watchdog 1 s trigger time supervising internal supply voltages and for power on reset 5 2 6 Communication Interfaces Type Maximal available counts Description GPS GLONASS 1 GLONASS GPS simultaneously 1 10 Hz update rate 33 tracking channels SBAS WAAS EGNOS MSAS GAGAN QZSS GSM GPRS 1 Five Band 3G HSPA Quad Band 2G GPR...

Page 28: ...y AdHoc mode WEP internal or external antenna option via SMA connector 5 2 7 Inputs and Outputs Type Maximal available counts Feature Range Digital input 1 Maximum input voltage 36 V DC Internal pull down resistor 10 kOhm ON threshold 1 7 V 3 3 V OFF threshold 0 7 V 2 V Digital Output 1 Maximum output voltage 8 V 32 V DC min UB 1 V max UB Maximum output current 0 5 A thermal over current limitatio...

Page 29: ...on class when connected IP6k7 Weight 0 3 kg 0 67 lbs Dimensions ca 183 mm x 117 mm x 36 mm 7 21 x 4 61 x 1 42 Operating temperature housing temperature 30 C 60 C 22 F 140 F Internal Temperature sensor measurement range 55 C 150 C Real time clock RTC Gold cap buffered with wakeup function Real time clock with internal gold cap for buffering time and data for approximately 4 days system wakeup funct...

Page 30: ...wn max 400 mA 12V 8 UB power supply 9 32VDC 9 GND shield USB WLAN 10 KL15 D switched power ignition switch 16 NC 17 Digital Input int 10kOhm pull down 18 RS232 RxD connect to PC SUB D Pin3 19 RS232 TxD connect to PC SUB D Pin2 20 CAN1 low termination required 21 CAN1 high termination required 22 CAN2 low termination required 23 CAN2 high termination required 24 NC 25 NC 26 Ethernet Rx equals a PCs...

Page 31: ...nd coefficient of friction COF To determine the torque of a screw use the stated preload force and the data of your used screw Sample torque Type of screw Material Structure robustness COF Preload force Torque DIN EN ISO 4762 M6 Steel 8 8 0 12 6 7 kN 9 0 kN 7 Nm 9 5Nm Make sure that you operate the TC1 always within the electrical and mechanical specifications defined by STW If you are not sure ab...

Page 32: ... The paint can damage the housing and gasket of the TC1 Provide proper ventilation The TC1 generates surplus heat during operation Keep the TC1 away from hot air and hot surfaces Hot air or hot surfaces can heat the TC1 to a not allowed temperature range Do not install the TC1 to your device with the connector or the cable harness pointing upwards If the connector or the cable harness points upwar...

Page 33: ... type of connectors see Connector on page 35 Attach the cable harness of the TC1 100mm 3 9 from the connector with a strain relief Attach the strain relief of the cable harness at the same surface where the TC1 is attached If the cable harness and the TC1 are attached to the same surface the vibration level of both is the same Different vibration levels can cause damage to the connector and to the...

Page 34: ...5 Hardware User Manual 34 374 5 6 Housing Connector Top view and side view Bottom View ...

Page 35: ... 374 5 7 Connector Mating connector The mating connector can be ordered from STW article no 48083 Manufacturer TYCO Type 3 rows female 29 pin 19 pins used 10 blank Manufacturer No 1 963449 1 Contact material JPT 0 5 1 0 mm CuFe ...

Page 36: ... Hirschmann Roof Mount Antenna CGW 70 26 59 SF S WLAN BLUETOOTH CELLULAR GSM GPS SMA male Hirschmann Low profile antenna GPS 18 90 LP P SMA SMA 3 0 CELLULAR GSM GPS SMA male Connector Type Use SMA male connectors on the antenna side REQUIREMENT Make sure to keep a minimum distance of 20 cm between the used antenna and people ...

Page 37: ...es the TAF Library which is written in C and can be used by the user to create teleservice applications and the TAF Components This includes the teleservice daemons and their configuration files High Level Hardware Access This level includes scripted files scripts and tools system helpers which provide more complex functionalities It uses the Low Level Interfaces to process functionalities e g mou...

Page 38: ...nel version 3 10 94 rt102 STW v1_03r0 Provides information about the used operating system and the used Linux kernel of the TC1 Device tree block cat proc device tree dts_version STW V X XXrX STW V0 01r0 Version of the device tree block for the TC1 U Boot fw_printenv ver ver u boot XXXX XX svnYYYY MMM DD yyyy hh mm ss ecu_b STW VX XXrX ver u boot 2012 10 svn9064 Jun 01 2016 10 58 25 tc3_b STW V2 0...

Page 39: ...zations are performed when executing the script etc init d rcS as specified in the initialization table etc inittab The specified initializations are performed through scripts that are located in the folder etc rc d First etc init d rcS sets the job control functions of the shell and loads the latest configuration information from etc rc d rc conf If rcS was called with the parameter start the var...

Page 40: ...p_forwarding taf proftpd For shutdown following scrips will be called cfg_services_r proftpd taf ip_forwarding dnsmasq bt wlan ysysd_daemon messagebus gps ssh telnetd settime syslog gsm network wakeup fstab_automount mdev rpc_services shalt etc init d rc local The script is responsible for performing all user defined actions Use this script to execute programs and scripts automatically at the end ...

Page 41: ...it d scripts ysysd_daemon p1 This is a shell script which executes the system daemon usr local bin ysysd p1 defines what action should be done start executes usr local bin ysysd stop kills ysysd etc init d scripts wakeup p1 This is a shell script which handles the wakeup reasons at start up and on shut down Wakeup reasons IGN System was started by ignition RTC System was started by RTC alarm The w...

Page 42: ...keup time in second default is 0 export SD_RUN_TIME_IGN 0 RTC wakeup time in seconds default is 20s export SD_RUN_TIME_RTC 20 Shutdown run time path includes the time in seconds export SD_RUN_TIME_FILE tmp sdruntime 6 3 1 Ignition The state of the ignition can be retrieved over the function of the system daemon Precondition The system daemon see System daemon on page 88 must be already started Per...

Page 43: ... RTC is used to synchronize the kernel clock during the boot up and the shut down sequence During boot up the kernel clock is synchronized to the RTC During shut down the RTC is synchronized to the kernel clock High Level Hardware Access Path Input information Output information Description etc init d scripts settime p1 This shell script starts the clock synchronization over SNTP settime is active...

Page 44: ...ace interface gets the current date from the kernel clock p1 YYYY MM DD returns the date formated like the given syntax sys class rtc rtc0 time p1 This user space interface gets the current time from the kernel clock p1 hh mm ss returns the time formated like the given syntax sys class rtc rtc0 wakealarm p1 This user space interface can be used for setting the hardware RTC wakeup alarm After a shu...

Page 45: ...6 Software User Manual 45 374 Example Handle wakeup alarm Sets the wakeup alarm off echo 0 sys class rtc rtc0 wakealarm Sets the wakeup alarm to 10 seconds echo 10 sys class rtc rtc0 wakealarm ...

Page 46: ...onnectivity mode ynetworkd_stop_connection see ynetworkd_stop_connection on page 238 The TAF library function disconnects the current network connection High Level Hardware Access Path Input information Output information Description etc init d scripts network p1 Interfaces file etc network interfaces includes the following network options dhcp get IP via DHCP lan_static static IP from etc init d ...

Page 47: ...rted automatically by the boot up sequence p1 defines what action should be done start switches the modem on set the SIM PIN if necessary create MUX devices and start APN detection stop switches the modem off restart calls stop calls start Interface at rc conf Set GSM parameters Set the GSM parameters to etc init d rc conf GSM baudrate Supported bit rates see table below export GSM_BAUDRATE 460800...

Page 48: ...oc device tree stw_gsm 00 name Interface name e g stw_gsm This user space interface includes the name of the modem interface proc device tree stw_gsm 00 port Path to real interface e g dev ttyACM0 This user space interface includes the real path to the modem serial interface proc stw_gsm gsm_power p1 This user space interface could be used in a sequence depending on modem type to switch the GSM mo...

Page 49: ...ovides an incorrect configuration too and the ppp connection fails There are two options to handle that issue Set GPRS parameters manually in the file etc init d rc conf If you never want to change your mobile provider than set the necessary provider informations This mechanism disables the automatically detection of the provider settings Disadvantage After changing the SIM card for example you us...

Page 50: ...ration files will be created etc ppp pap secrets PAP secrets for pppd etc ppp gprs options_gsm option file for pppd This shell script starts the usr sbin pppd PPP connection to establish a GPRS connection It uses dev mux0 and if the etc init d rc conf GSM settings are NOT activated then the automatically created APN settings will be used etc ppp ppp stop This shell script kills the usr sbin pppd t...

Page 51: ...e is C a local echo is no noinit is no noreset is no nolock is no send_cmd is sz vv receive_cmd is rz vv imap is omap is emap is crcrlf delbs Terminal ready 2 Put the modem in SMS mode AT CMGF 1 ENTER OK 3 Send the message AT CMGS 49160XXXXXXX ENTER This is a sample Text ENTER It was send from the TC3G CTRL Z CMGS 55 OK 4 Disconnect from the modem CTRL A Q Thanks for using picocom 6 4 2 Ethernet T...

Page 52: ...ly fall back to mode STATIC if ETH0_CONF is set to STATIC then the static settings below will be used if ETH0_CONF is set to UBOOT then the settings will not be touched Note also adapt the setting in sbin dhclient for the gateway entries export ETH0_CONF STATIC Static settings for eth0 if ETH0_CONF STATIC Note ETH0_GW is also important if you use ETH0_CONF UBOOT IP of eth0 if ETH0_CONF STATIC expo...

Page 53: ... Set port in Network Byte Order Big Endian to sin_port s16_Return connect s16_Sockfd struct sockaddr t_Srv sizeof struct sockaddr_in Try to connect if s16_Return 0 TCP connection is established Now write and read could be used to to write or read sockets Data handling shutdown s16_Sockfd SHUT_WR Send a EOF Byte to the server so that on the next read we will get a 0 return and we could close the co...

Page 54: ... init d scripts wlan p1 Only available when a hardware WLAN module exists on the used TC1 This shell script loads the WLAN module in the kernel during system boot up p1 start checks if MAC address is set loads the specific WLAN modules to the kernel starts AP or managed mode stop stops started daemons unloads specific WLAN modules from kernel restart calls stop calls start Get local information It...

Page 55: ...default mode of the TC1 WLAN module Interface rc conf Setup IP parameters for startup in AP mode Setup the IP handling strategy in etc init d rc conf NETWORK WLAN0 WLAN0_CONF AP sets the WLAN interface into AP mode export WLAN0_CONF AP IP of wlan0 export WLAN0_IP 192 168 201 1 Submask of wlan0 export WLAN0_SUBMASK 255 255 255 0 Broadcast address of wlan0 export WLAN_BR 192 168 201 255 Gateway of w...

Page 56: ...If you want to allow non root users to use the contron interface add a new group and change this value to match with that group Add users that should have control interface access to this group This variable can be a group name or gid ctrl_interface_group 0 IEEE 802 11 related configuration SSID to be used in IEEE 802 11 management frames Will be set automatically to hostname ssid tc3g Country cod...

Page 57: ...1x must be set but without dynamic WEP keys RADIUS authentication server must be configured and WPA EAP must be included in wpa_key_mgmt This field is a bit field that can be used to enable WPA IEEE 802 11i D3 0 and or WPA2 full IEEE 802 11i RSN bit0 WPA bit1 IEEE 802 11i RSN WPA2 dot11RSNAEnabled wpa 2 WPA pre shared keys for WPA PSK This can be either entered as a 256 bit secret in hex format 64...

Page 58: ...l to a free channel To retrieve available channels use the iw list command A free channel in Germany for example can be 44 channel 44 After setting the correct value the TC1 needs to be restarted The last parameter that needs to be checked is the transmit power It can be read with iwconfig wlan0 wlan0 IEEE 802 11abgn Mode Master Tx Power 20 dBm Retry long limit 7 RTS thr off Fragment thr off Power...

Page 59: ...Examples of Country Codes on page 59 The Country code is used to set regulatory domain Set as needed to indicate the country in which the device is operating This can limit available channels and transmition power Default is the minimum subset off all available restrictions world 00 country DE The scan_ssid parameter is needed for networks with hidden SSIDs It needs to be placed directly below the...

Page 60: ...RP 2 4 2 4835 2 4 2 454 GB United Kingdom a 36 40 44 48 52 56 60 64 104 108 112 116 120 124 128 132 140 200 mW EIRP 200 mW EIRP 1 W EIRP 5 15 5 25 5 25 5 35 5 47 5 725 b g 1 11 100 mW EIRP 2 4 2 4835 IT Italy a 36 40 44 48 52 56 60 64 104 108 112 116 120 124 128 132 140 200 mW EIRP 200 mW EIRP 1 W EIRP 5 15 5 25 5 25 5 35 5 47 5 725 b g 1 11 100 mW EIRP 2 4 2 4835 US United States of America a 36 ...

Page 61: ...and NAT services for the selected interface p1 start starts service for eth0 wlan0 ppp0 if service is set to ON in rc conf and NAT else IP Forwarding is switched off anyway NAT for ppp0 is set by default stop stops IP Forwarding anyway restart reload processes stop and start Interface at rc conf Set DNSMASQ IP forwarding and NAT parameters Handling those settings in etc init d rc conf DNSMASQ IP F...

Page 62: ...t API has been designed as similar as possible to the TCP IP protocols to allow programmers who are familiar with network programming easily to learn how to use CAN sockets Get local information It is possible to read out the local settings of the can0 and can1 devices such as RX bytes TX bytes ifconfig can0 ifconfig can1 can0 Link encap UNSPEC HWaddr 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0...

Page 63: ...ivate export SYSCFG_CAN1 y Baudrate of can1 export SYSCFG_CAN1_BAUD 500000 Example Change bitrate of can0 Handling the user space interface can0 by using sbin ifconfig provided by the BusyBox multi call binary and sbin ip Stop can0 change bitrate to 250000 and restart can0 ifconfig can0 down bin ip link set can0 up type can bitrate 250000 ifconfig can0 up Example Socket CAN for C programming inclu...

Page 64: ...the TC1 and how a Bluetooth connection can be established to other systems High Level Hardware Access Path Input information Output information Description etc init d scripts bt p1 This shell script handles the Bluetooth module and is automatically started by the boot up sequence p1 defines what action should be done start initializes bluetooth port starts bluetooth module starts the bluetooth dae...

Page 65: ... Scan the environment for other devices hcitool scan Scanning 00 15 83 41 79 8D TEST PC Achieving a bluetooth connection to the TC1 from different operating systems Connect to TC1 from windows based systems over serial port Windows 7 or newer operating system based devices can connect to the TC1 The device has to be added with paring code 0000 Check the properties of the device to identify the use...

Page 66: ... based systems for file sharing In order to connect to the TC1 from android based systems a similar APP like Bluetooth File Transfer has to be used NOTE The file sharing folder on the TC1 is tmp The default configuration of the TC1 does not need to be changed ...

Page 67: ... conf RFCOMM configuration file rfcomm0 Automatically bind the device at startup bind yes Bluetooth address of the device device 00 15 83 41 79 8D RFCOMM channel for the connection channel 7 Description of the connection comment Linux VM It is necessary to gain root privileges Use the obexfs tool to connect to the TC1 and mount the connection to bluetooth_test root pc name obexfs b 00 07 80 97 E7 ...

Page 68: ...D EEPROM Overview of the memory mapping Root file system image Unsorted Block File System UBIFS Kernel image Includes the linux kernel U Boot Bootloader which initializes and loads the linux kernel U Boot environment U Boot specific environment variables Flattened device tree Used by the U Boot to identify the hardware NAND Flash Path for the user data EEPROM User area ...

Page 69: ...df The dataflash is the only partition that is not mounted to RAM All other have a partition size of 8MB exclude the rootfs itself which has a size of 48 MB After the kernel has been loaded by the U Boot from RAM the system partitions are df Filesystem Size Used Available Use Mounted on ubi0 rootfs 48 6M 39 7M 8 9M 82 rwfs 7 9M 312 0K 7 6M 4 mnt rwfs rwfs 7 9M 312 0K 7 6M 4 tmp rwfs 7 9M 312 0K 7 ...

Page 70: ...udes the device and partition information of the system proc cmdline This user space interface includes the command line parameters which the kernel itself was booted Example Read device and partition information cat proc mtd dev size erasesize name mtd0 03700000 00020000 rootfs mtd1 00800000 00020000 kernel mtd2 00040000 00020000 u boot mtd3 00020000 00020000 u boot env mtd4 000a0000 00020000 fdt...

Page 71: ...ter device includes the interface to a reserved part of the FDT dev mtd4 dev mtd6 This character device includes the interface to the nand flash Example Read memory information Read memory information from dev mtd0 by using usr sbin mtdinfo mtdinfo dev mtd0 mtd0 Name rootfs Type nor Eraseblock size 131072 bytes 128 0 KiB Amount of eraseblocks 440 57671680 bytes 55 0 MiB Minimum input output unit s...

Page 72: ...tory structure that is created in the NORFlash root This is the root users s home directory Here are saved all personal data and terminal configurations of the root user Only the root user has the writing permission for this directory NOTE Do not get confused between and root is the main folder from that all directories start ...

Page 73: ...personal files For example home default lib System Libraries Contains library files that supports the binaries located under bin and sbin Library filenames are either ld or lib so mnt Mount Directory Temporary directory where system administrators can mount filesystems opt Optional add on Applications Contains add on applications from individual vendors Add on applications should be installed unde...

Page 74: ...ary Files Contains temporary files created by system and users Files in this directory are deleted when system is rebooted usr User Programs Contains binaries libraries documentation and source code for second level programs usr bin contains binary files for user programs If a user binary cannot be found under bin it might be under usr bin For example at awk chat less usr sbin contains binary file...

Page 75: ...esponding daemon will start The folder also includes the user startup script rc local and the global startup script rcS etc init d scripts Contains all boot scripts which are necessary for starting up the system home Contains the home folder of the default ftp and ssh user mnt dataflash Contains the NAND when it is mounted Mount the NAND in order to store files into it Otherwise the files will be ...

Page 76: ...erlay Filesystem Overlay filesystem The overlay filesystem is a feature that uses the mechanism of the UnionFS filesystem of the Linux kernel For details see http unionfs filesystems org see Link to UnionFS homepage http unionfs filesystems org If the system is updated with the latest BSP all modifications will be overwritten The root filesystem must be customized again which is an unnecessary wor...

Page 77: ...nd root directories of the root filesystem are automatically overlaid with the content of directory mnt dataflash stw overlay For example the etc directory is overlaid with mnt dataflash stw overlay etc If a user changes or deletes a file in one of these root filesystem directories the changes will be stored in the corresponding mnt dataflash stw overlay directory Activate the overlay filesystem i...

Page 78: ... dataflash stw overlay etc init d rc conf The original root filesystem remains unchanged If the user deletes the mnt dataflash stw overlay etc init d rc conf file the original etc init d rc conf file from the rootfs will be restored Example2 If the user deletes the etc init d scripts bt script in the root filesystem then the TC1 behaves like the file is gone But the file is not really deleted Only...

Page 79: ...creating one volume named dataflash on the flash using all available flash memory usr local bin nand_mount sh This shell script attaches and mounts the volume dataflash of the NAND flash to mnt dataflash Assumption the NAND flash contains a volume called dataflash e g use nand_prepare sh to format flash and create the volume mount point mnt dataflash must exist usr local bin nand_ismounted sh p1 T...

Page 80: ...t unit size 2048 bytes Sub page size 512 bytes OOB size 64 bytes Character device major minor 90 12 Bad blocks are allowed true Device is writable true 6 5 3 EEPROM Low Level Hardware Access Path Input information Output information Description sys bus i2c devices 0 0050 eeprom Write 1 7168 bytes Read out 1 7168bytes This user space interface represents the EXTERN 7kB EEPROM The user can handle it...

Page 81: ...ed EEPROM is read only unlocked EEPROM is readable writable Example Read system parameters from EEPROM stw_eep r variant Y_TC3G Path Input information Output information Description sys bus i2c devices 0 0050 eeprom_sys This user space interface represents the internal 1kB EEPROM only used by STW sys bus i2c devices 0 0050 lock_sys p1 p2 System file to switch eeprom_sys between read only and read ...

Page 82: ...atch_dog on page 153 The TAF library function deregisters the supervising from the system daemon High Level Hardware Access Path Input information Output information Description dev watchdog This device is created by the linux kernel that provides the interface of the software watchdog The watchdog has to be triggered each 60 seconds Low Level Hardware Access Path Input information Output informat...

Page 83: ...manually 54750 1000 54 750 C 6 8 GPS For GPS handling use the GPS daemon that handles the GPS interface automatically Precondition The GPS daemon must be started The GPS daemon is not started during the boot up automatically How to activate the network daemon see GPS daemon see GPS daemon on page 95 Library functions for the GPS Function Brief ygpsd_get_gps_data see ygpsd_get_gps_data on page 229 ...

Page 84: ...rt NMEA string from GPS module Symbolic link for the tty device dev ttyPSC2 the GPS module is connected to 6 9 Serial Low Level Hardware Access Path Input information Output information Description dev ttyPSC6 Transmit characters one by one Receives characters one by one This device created by the linux kernel provides the serial interface RS232 of the system The serial interface is already starte...

Page 85: ...R Open PIN1 if s16_Fd 0 Clear fds FD_ZERO t_Readfds Set FD_SET s16_Fd t_Readfds if select s16_Fd 1 t_Readfds NULL NULL t_Timeout 0 Check if the corresponding bit is set in the fds if FD_ISSET s16_Fd t_Readfds Read from proc stw_io PIN1 void read s16_Fd cn_Status sizeof charn If cn_Status is not Zero 0 0x30 than set cn_Status to zero else set it to 1 cn_Status cn_Status 0x30 0x30 0x31 Write to proc...

Page 86: ...t information Output information Description 0 digital value is low 1 n digital value is high proc stw_io PIN2 p1 This user space interface reads on digital output PIN p1 0 sets digital value to low level 1 n sets digital value to high level ...

Page 87: ...eleservice concept The foundation of this hierarchy is the Telematics Application Framework TAF This framework consists of a set of linux daemons and utilities that provide useful functions for the developer A typical teleservice application consists of a number of system components that are part of the dedicated teleservice module e g TC1 on the one hand and external components eg ESX remote comp...

Page 88: ...al 88 374 7 2 TAF Components TAF Components 7 2 1 System daemon The system daemon has a special role among the daemons The system daemon is already activated per default Daemon location Configuration file usr local bin ysysd etc init d ysysd conf ...

Page 89: ...uration of the daemon could be handled in its own configuration file ysysd conf Relevant sections of the configuration file Section Log file path The logging information can be written to a log file at the following path By default the path is deactivated because the corresponding line is commented out Max path length is 255 If the path is deactivated or no path is set an error message will be put...

Page 90: ...tion off When the ignition pins goes off the controller TC1 can keep on running for a certain amount of time User space applications can also set the desired time Max path length 255 If the path is deactivated or no path is set an error message will be put on stdout runtimefile_path tmp sdruntime Section Run time interval The run time interval is in seconds Min 0 Max recommended 10s default interv...

Page 91: ...ccess to common data pools It gives applications and processes the opportunity to define create and delete variable lists via D Bus commands In order to achieve quick response times and a generally good performance when working with those variables writing and reading will be handled by the shared memory mechanism Basic configuration of the daemon can be handled in its own configuration file ydata...

Page 92: ...t Section Variable lists path The data daemon creates temporary variable list files during operation in the following path If no path is set the default path var run taf Datapools will be always set by the daemon Max path length 255 BaseFolderTmp var run taf Datapools Section Data pools path The data daemon provides also the possibility to configure data pools automatically at startup In that case...

Page 93: ...ng daemon ylogd offers the opportunity to create dynamic or static logging jobs Applications can add variables to the job which should be logged and define trigger conditions on those variables that make the daemon write a new data record into the log file Basic configuration of the daemon can be handled in its own configuration file ylogd config Relevant sections of the configuration file Section...

Page 94: ...Data logger path The data logging daemon provides also the possibility to configure data logger automatically at startup In that case all data logger which shall be configured at startup must be placed in the following path Max path length 255 If no path is set the default path opt taf DLC will be set DlcFolderStatic opt taf DLC Section Set data logger configuration mode 1 TRUE Data pool configura...

Page 95: ...logger file The interval value is set in bytes Per default the mechanism is disabled because it s only necessary in combination with the yserverd If 0 is set the mechanism is disabled default If the value is 0 10000 the value will be set to 10000 If the value is 1048576 bytes 1024 1024 1 MB the vale will be set to 1 MB FullDatasetInt 0 ...

Page 96: ...vides position date and time information from the GPS module Basic configuration of the daemon could be handled in its own configuration file ygpsd config Relevant sections of the configuration file Section Log file path The logging information can be written to a log file at the following path By default the path is deactivated because the corresponding line is commented out Max path length is 25...

Page 97: ...tcp_port 5894 Section Synchronize system time date The GPS daemon can set the linux system time and or the hardware clock RTC chip automatically when ever it gets its valid time from the GPS satellites Activate the two functions by uncommenting the following line deactivate this by commenting or deleting the line auto_set_system_time auto_set_rtc_time RTC_path let you select the device that shall ...

Page 98: ...als to all applications that are listening on the D Bus Outgoing SMS can be handed over to the daemon via D Bus methods Basic configuration of the daemon could be handled in its own configuration file ysmsd config Relevant sections of the configuration file Section Log file path The logging information can be written to a log file at the following path By default the path is deactivated because th...

Page 99: ...e set to 3 and an error message will be put on stdout NoNetRegCounter 240 Section GSM status interval The SMS daemon supervises the needed GSM status periodically Every verify_gsm_status_interval seconds Min interval and default is 120s max interval is 0x7FFFFFFF recommended max is 1000s If the interval is less than 120s the default will be set and an error message will be put on stdout verify_gsm...

Page 100: ...boot up sequence automatically 1 Rename the configuration file ynetworkd the following way mv etc init d _ynetworkd config etc init d ynetworkd config 2 Reboot the system reboot ynetworkd The ynetwork daemon provides functions to manage the internet connectivity automatically Via D Bus the ynetworkd can be switched from enabled connectivity to disabled connectivity It is also possible to get the a...

Page 101: ...Activate 1 deactivate 0 connectivity at startup default is 0 If the value is set to zero the connectivity can be activated via D Bus signal see TAF library If value unequal 0 1 or not set default will be set and an error message will be put on stdout activate_connectivity 1 Section Matrix of supervised interfaces With this option you can select the interfaces that shall be supervised by ynetworkd ...

Page 102: ...seconds until ping succeed Min timeout and default is 15s max timeout 0xFFFFs If no timeout is set default will be set ping_timeout 15 File supervision For file supervision modus it s necessary to set the server and the file name Max URL length 255 If no path is set an error message will be put to stdout Daemon will not be started FileServerAddr www google de File name of the file to verify Max fi...

Page 103: ...FFFFs If search time is less than 5 default search time will be set ppp_net_search_time 10 After trying NO_NETWORK_REG_COUNTER times the GSM modem will restart Min number of tries and default is 3 max number of tries is 0xFFFF If the tries number is less than 3 default tries number will be set NO_NETWORK_REG_COUNTER 3 Section WLAN settings To start and stop connections via WLAN the ynetworkd uses ...

Page 104: ...f no path is set an error message will be put on stdout Daemon will not be started eth_stop_script sbin ifdown eth0 lan_static_networkd For dynamic usage Start eth0 connection with dhcp Max path length 255 If no path is set an error message will be put on stdout Daemon will not be started eth_start_script sbin ifup eth0 dhcp Stop eth0 connection with dhcp Max path length 255 If no path is set an e...

Page 105: ...rd uses one of the interfaces selected in the ynetworkd In a periodic interval the server daemon requests a specified file from the server This file can be configured in the yserverd specific configuration file Via HTTP the file is requested and afterwards interpreted All known commands are send to the corresponding daemons After the command was completed it s also possible to send a reply to the ...

Page 106: ...ult will be set 100s watchdog_interval 100 System reboot path max path length 512 After the time has elapsed without triggering the watchdog the ysysd would kill the yserverd and execute the CMDOnWatchdog command If no path is set default signal01 beep will be set CMDOnWatchdog sbin reboot Section Specific configuration files path Path to the specific configuration files Max path length is 512 If ...

Page 107: ...m_server_path_put ec2c client_id Section Communication port number Port number Min port number is 0 max port number is 0xFFFF default port number is 80 If no port number is set default port will be set 80 port_no 8080 Section Basic http authentification User name and corresponding password for the HTTP basic authentication is necessary to access the server The maximum length for the user name and ...

Page 108: ...ecific connection will not be started connection_cycle_timeout 360 Section Data logger transmission size This section sets the maximum data logger transmission size in bytes before the end file is created The default value is 0 this means that the end file is created after the complete transmission of the data logger file Min and default size is 0 max size is 0xFFFFFFFF If no size is set the defau...

Page 109: ...ivate the configuration file of the signal daemon so the signal daemon is started during the boot up sequence automatically 1 Rename the configuration file of the ysignald the following way mv etc init d _ysignald config etc init d ysignald config 2 Reboot the system reboot ysignald The signal daemon signalizes the current status of the module over led signal NOTE The signal daemon can only be use...

Page 110: ...active CAN traffic flashing LED without changing its color This state is active when there is traffic on CAN0 or CAN1 Error blink code initialized by a red LED signal This state is active when a Goodbye signal from a daemon is received or when a valid entry in the tmp LED_Error file exists User blink code initialized by a pause of the LED signal This state is active when a valid entry in the tmp L...

Page 111: ... 5 pink 6 cyan 7 white p2 defines how often the signal should flash 0 ON for 2 seconds 1 flash 1 time x flash x times STW LED tmp LED_Error p1 p2 This file includes the parameters for the Error states p1 defines the color of the LED 2 green 3 yellow 4 blue 5 pink 6 cyan 7 white p2 defines how often the signal should flash 1 flash 1 time x flash x times NOTE If the parameters of the LED_User LED_Er...

Page 112: ...boot path max path length 256 After the time has elapsed without triggering the watchdog the ysysd would kill the ynetworkd and execute the CMDOnWatchdog command If no path is set default signal01 beep will be set CMDOnWatchdog sbin reboot Section Using the signal daemon without the TAF components ynetwork and or ygpsd This setting makes the internet state independent of the ynetworkd ysignald wil...

Page 113: ... module alternately The signal below shows alternating the GPS Internet state and the the User state The matching entry in the LED_User file would be 4 3 echo 4 3 tmp LED_User The signal below shows alternating the GPS state and the User state The matching entry in the LED_User file would be 2 2 echo 2 2 tmp LED_User This signal shows alternating the Error state and the User state The matching ent...

Page 114: ...S pink 1 The ynetworkd daemon is no longer on the D BUS pink 2 Communication with the modem of the TC3G failed OR creating APN settings failed OR reading APN settings failed pink 3 APN settings not valid e g TC3G could not interpret provider or country code yellow 1 One of the other daemons ysysd ydatad ylogd ysmsd ymeetd or yserverd is no longer on the D BUS NOTE It is possible that the module is...

Page 115: ...ess to the D Bus and does not register itself to the ysysd If you are using the ymaild the first time then refer to Setup ymaild for the first time see Setup ymaild for the first time on page 118 Relevant sections of the configuration file Section Log file path The logging information can be written to a log file at the following path The path is deactivated by default Max path length is 255 If no...

Page 116: ...y to replace existing files on the TC1 Those files have to be in the attachment of the e mail sent to the TC1 The ymaild will replace the file s in the specified directories The replaced files will keep the same permissions as before Syntax file_name folder_path Example replace the configuration file of ysignald and ymaild replace_file ysignald config etc ymaild config etc replace_file add a file ...

Page 117: ...com del_user Important Example This example describes how to get all log files from the var directory Also this mail must be sent to a colleague who is not on the mail list yet Mail content get_file log var get_file add_user colleague email address com add_user It is important to choose Option Encryption before sending the e mail NOTE The subject of the e mail needs to include the serial number of...

Page 118: ...ontent of that mail will be similar to get_file log var get_file add_user college email address com add_user Task get_file File s to be searched log File s found and attached to this email var log ysignald log var log ysysd log Task add_user User s that should be added college email address com user college email address com was added to user list sent from my TC1 ...

Page 119: ...ail com set smtp use starttls set ssl verify ignore set smtp smtp smtp gmail com 587 set smtp auth login set smtp auth user example gmail com set smtp auth password 123456 using a signature is not mandatory set signature etc maild signature encryption set smime force encryption set smime sign cert etc maild certificate TC3Gpubl priv pem include mailing list set NAIL_EXTRA_RC etc maild mail list ma...

Page 120: ...C needs to be set emailAddressTC3G needs to be set validDays 9999 keySize 2048 create_cert sh file This is the script that needs to be executed in order to generate the necessary certificate files It is recommended to select a password Those files are PCpubl pem Public key of the PC that wants to communicate with the TC1 needs to stay on the device for encryption PCpubl priv pfx Public and private...

Page 121: ... mail addresses embedded 1 E mail address for communicating The user wants to send and receive encrypted e mails from the TC1 Best Practice example for a team of developers Create an e mail account especially for encrypted communication with the TC1 Everyone will be able to communicate with the TC1 via this particular mail account 2 E mail address for observing Each user who wants to observe the c...

Page 122: ...ntinue with step 3 if communication is required 3 Import both certificates to trusted root certificates Click Start Click Start Search Type mmc Press ENTER Click Add Remove Snap in on the file menu Click certificate Under available snap ins Click Add Select the computer whose local Group Policy object GPO you want to edit and then click Finish If you have no more snap ins to add to the console cli...

Page 123: ...pen Outlook 2013 Go to Options Trust Center Settings of the Trust Center E Mail Security Settings Choose the certificate and click OK 6 The CER file needs to be added to the Outlook contact of the TC1 in order to encrypt outgoing messages Open Create TC1 contact information Go to contact certificate import Import the CER file and click OK and save the settings ...

Page 124: ...onditions are met The daemon binary file has to be located within the directory usr local bin Every daemon needs a configuration file The configuration file has to be in the directory etc init d The configuration file name is equal to the corresponding daemon name and the extension config A daemon can be started manually like in the following example ylogd ylogd config dev null NOTE The following ...

Page 125: ...7 Teleservice Application Framework User Manual 125 374 TAF overview ...

Page 126: ...ear type definitions and prefixes STW type Prefix Size Range hexadecimal HEX Range decimal DEC C equivalent uint8 u8_ 8 bit 0x00 0xFF 0 255 unsigned char sint8 s8_ 8 bit 0x80 0x7F 128 127 signed char uint16 u16_ 16 bit 0x0000 0xFFFF 0 65535 unsigned short int sint16 s16_ 16 bit 0x8000 0x7FFF 32768 32767 signed short int uint32 u32_ 32 bit 0x00000000 0xFFFFFFFF 0 4294967295 unsigned long int sint32...

Page 127: ...to increase the performance However boolean is target specific and should be used with care On some platforms a boolean variable takes 1 bit of memory Such a variable can only be 0 or 1 but can not be referenced by pointers or members of a structure Other platforms define boolean as an integer variable In this case it is not guaranteed that the value of this variable is 0 or 1 it could also be gre...

Page 128: ...ption t_ T_Struct t_Struct structure or bitfield u_ U_Union u_Union union e_ E_Enum e_Enum enum pr_ PR_Function pr_FunctionPointer function pointer pv_ void pv_VoidPointer void pointer s_ charn s_Text 3 12 zero 0 terminated string Modifier prefixes Prefix Example Description p type prefix uint8 pu8_Example pointer of type a type prefix uint8 au8_Example 4 array of type Area of validity prefixes Pr...

Page 129: ...cture variable static T_StructType mt_MyStruct typedef for function pointer for a module DigIN typedef void PR_DIN_CallBack const uint8 ou8_Parameter global function pointer in module DigIN PR_DIN_CallBack gpr_DIN_CallBack 7 3 2 2 Function descriptions The following gives you a quick overview about how a function description in this document looks like First there is a function description see Fun...

Page 130: ...arName1 0 63 8 bit input parameter ou32_VarName2 0x00000000 0xFFFFFFFF no limitation 32 bit input parameter Output Information Result Range Description opu16_PointerName 0x0000 0xFFFF no limitation Pointer to 16 bit output parameter variable Return Value Description C_NO_ERR function executed without error C_RANGE parameter ou8_VarName1 out of range WARNING DO NOT USE undocumented BIOS functions T...

Page 131: ... Error Codes The error codes used by the C BIOS API functions are handled by using macros The following macros are defined Macro Value Description C_NO_ERR 0 Function executed without error C_UNKNOWN_ERR 1 Unknown error C_WARN 2 Warning error C_DEFAULT 3 Default error C_BUSY 4 Busy error C_RANGE 5 Range error C_OVERFLOW 6 Overflow error C_RD_WR 7 Read Write error NOTE The corresponding values here...

Page 132: ...r C_CONFIG 10 Configuration error C_CHECKSUM 11 Checksum error C_TIMEOUT 12 Timeout occurred C_IN_PROGRESS 13 Asynchronous operation still in progress Example Error code handling example sint16 s16_Result s16_Result x_sys_stay_alive X_ON if s16_Result C_NO_ERR if reached then this means that function x_sys_stay_alive has been executed successfully ...

Page 133: ...onnection instance charn acn_myNameString 128 Name of the application Don t use any special characters white spaces or new lines charn acn_myVersion 128 Additional value for HELLO signal opt charn acn_myStatus 128 Additional value for HELLO signal opt charn acn_myAddInfo 512 Additional value for HELLO signal opt sint32 s32_myTriginterval Time interval when the ysysd expects to be triggered charn a...

Page 134: ...ve to be seen on the D Bus dbus_bus_add_match mt_dbus_util pt_dbus_conn type signal interface stw taf broadcast NULL dbus_connection_flush mt_dbus_util pt_dbus_conn dbus_bus_add_match mt_dbus_util pt_dbus_conn type method interface stw taf ysysd NULL dbus_connection_flush mt_dbus_util pt_dbus_conn More initialization steps Start main loop while 1 Trigger the watchdog every 1 seconds void usleep 10...

Page 135: ...aracters white spaces or new lines charn acn_myVersion 128 Additional value for HELLO signal opt charn acn_myStatus 128 Additional value for HELLO signal opt charn acn_myAddInfo 512 Additional value for HELLO signal opt sint32 s32_myTriginterval Time interval when the ysysd expects to be triggered charn acn_myCMDOnWatchdog 2048 Bash cmd that must be executed by the ysysd in case no trigger signal ...

Page 136: ...ange Description opt_DBusInstance T_DBUS_Util pt_dbus_conn includes the connection instance which is generated by the D Bus Structure T_DBUS_Util typedef struct DBusConnection pt_dbus_conn D BUS connection instance charn acn_myNameString 128 Name of the application Don t use any special characters white spaces or new lines charn acn_myVersion 128 Additional value for HELLO signal opt charn acn_myS...

Page 137: ...ating applications Information Flow Input Information Parameter Range Description opt_DBusInstance T_DBUS_Util holds all D Bus information Structure T_DBUS_Util typedef struct DBusConnection pt_dbus_conn D BUS connection instance charn acn_myNameString 128 Name of the application Don t use any special characters white spaces or new lines charn acn_myVersion 128 Additional value for HELLO signal op...

Page 138: ... dbus_send_hello_signal mt_DBUS_Util if s32_Retval C_NO_ERR Handle error cases 7 3 3 6 dbus_send_goodbye_signal Function Description sint32 dbus_send_goodbye_signal const T_DBUS_Util const opt_DBusInstance This function informs other application over D Bus that your application will be closed The function creates a goodbye signal and sends it over the D Bus so other applications can listen Use thi...

Page 139: ...e for HELLO signal opt charn acn_myAddInfo 512 Additional value for HELLO signal opt sint32 s32_myTriginterval Time interval when the ysysd expects to be triggered charn acn_myCMDOnWatchdog 2048 Bash cmd that must be executed by the ysysd in case no trigger signal occurred in time T_DBUS_Util Output Information Return Value Description C_NO_ERR Function executed without error C_UNKNOWN_ERR DBUS si...

Page 140: ...T_DBUS_Util holds all D Bus information Structure T_DBUS_Util typedef struct DBusConnection pt_dbus_conn D BUS connection instance charn acn_myNameString 128 Name of the application Don t use any special characters white spaces or new lines charn acn_myVersion 128 Additional value for HELLO signal opt charn acn_myStatus 128 Additional value for HELLO signal opt charn acn_myAddInfo 512 Additional v...

Page 141: ...od on D Bus target with one string argument and receives a one string answer Information Flow Input Information Parameter Range Description opt_DBusInstance T_DBUS_Util holds all D Bus information opcn_DBusTarget maximal 240 contains target on D Bus e g ysysd opcn_MethodName maximum the name length we expect to call pointer to the method from target e g GetGSMMode opcn_MethodArgument maximum the n...

Page 142: ...ects to be triggered charn acn_myCMDOnWatchdog 2048 Bash cmd that must be executed by the ysysd in case no trigger signal occurred in time T_DBUS_Util Return Value Description C_NO_ERR Function executed without error C_UNKNOWN_ERR Error sending the method call C_COM Error receiving the method call answer C_NOACT Answer string received but it starts with ERROR C_OVERFLOW Answer string is larger tha...

Page 143: ...length we expect to call pointer to the signal argument e g 12345 Structure T_DBUS_Util typedef struct DBusConnection pt_dbus_conn D BUS connection instance charn acn_myNameString 128 Name of the application Don t use any special characters white spaces or new lines charn acn_myVersion 128 Additional value for HELLO signal opt charn acn_myStatus 128 Additional value for HELLO signal opt charn acn_...

Page 144: ...allback const PR_LIBTAF_GET_GOODBYE opr_GoodbyeCallback const PR_LIBTAF_GET_NRTI opr_NetworkResponseTimeIndicator const PR_LIBTAF_WHOISTHERE_NOTIFICATION opr_WhoIsThereCallback const PR_LIBTAF_USER_MESSAGE_NOTIFICATION opr_UserMessageCallback The TAF informs your application about certain events regarding the GSM communication Register your own callback functions with the TAF with this function Th...

Page 145: ...umber 20 characters Phone number of the subscriber which has sent the received SMS opcn_Message 0 160 characters Received SMS Hello typedef void PR_LIBTAF_GET_HELLO const charn const opcn_DaemonName Output Information Parameter Range Description opcn_DaemonName 0 128 characters examples for typical daemon names ylogd ydatad ysmsd Name of the daemon which has sent the hello signal Network notificat...

Page 146: ... NRTI NetworkResponseTimeIndicator typedef void PR_LIBTAF_GET_NRTI const charn const opcn_NetworkTimeIndicator Output Information Parameter Range Description opcn_NetworkTimeIndicator 0 128 characters network response time indicator in milliseconds only an approximate value WhoIsThere typedef void PR_LIBTAF_WHOISTHERE_NOTIFICATION const charn const opcn_DaemonName Output Information Parameter Rang...

Page 147: ...const charn const opcn_PhoneNumber const charn const opcn_Message TODO static void mv_Hello_Callback const charn const opcn_DaemonName TODO static void mv_NetworkNotification_Callback const charn const opcn_InterfaceName const charn const opcn_InterfaceStatus TODO static void mv_Goodbye_Callback const charn const opcn_DaemonName TODO static void mv_NRTI_Callback const charn const opcn_NetworkTimeI...

Page 148: ...ucture T_DBUS_Util void sprintf mt_dbus_util acn_myNameString MY_DBUS_NAME void sprintf mt_dbus_util acn_myVersion PROG_VERSION void sprintf mt_dbus_util acn_myStatus unknown void sprintf mt_dbus_util acn_myAddInfo MY_DBUS_ADDINFO Register with DBUS if dbus_get_on_the_bus mt_dbus_util 0 void utils_log_print Register ysignald on DBUS failed return 0 Add rules for which messages we want to see on th...

Page 149: ... periodically in order to allow the TAF library to check for signals on the D Bus and to call your registered callback functions Information Flow Input Information Parameter Range Description opt_DBusInstance T_DBUS_Util holds all D Bus information Structure T_DBUS_Util typedef struct DBusConnection pt_dbus_conn D BUS connection instance charn acn_myNameString 128 Name of the application Don t use...

Page 150: ...uted without error C_COM If any error occurs while communicating via D Bus C_CONFIG D Bus instance is not correct an instance of type T_DBUS_Util is expected Example Global Module sint32_Retval C_NO_ERR T_DBUS_Util mt_DBUS_Util while 1 s32_Retval dbus_process_requests mt_DBUS_Util if s32_Retval C_NO_ERR Handle error cases ...

Page 151: ... at the end of your application Information Flow Input Information Parameter Range Description opt_DBusInstance T_DBUS_Util holds all D Bus information Structure T_DBUS_Util typedef struct DBusConnection pt_dbus_conn D BUS connection instance charn acn_myNameString 128 Name of the application Don t use any special characters white spaces or new lines charn acn_myVersion 128 Additional value for HE...

Page 152: ...ystem daemon to prevent it to kill the application This functions needs to be called within the registered time interval set during the ysysd_register_watch_dog function call in the parameter opt_DBusInstance Information Flow Input Information Parameter Range Description opt_DBusInstance T_DBUS_Util holds all D Bus information Structure T_DBUS_Util typedef struct DBusConnection pt_dbus_conn D BUS ...

Page 153: ...the supervision of our application Make sure that this function is called whenever your applications ends even by kill or ctrl c Otherwise the system daemon will execute the acn_myCMDOnWatchdog command after the trigger time has elapsed Information Flow Input Information Parameter Range Description opt_DBusInstance T_DBUS_Util holds all D Bus information Structure T_DBUS_Util typedef struct DBusCo...

Page 154: ... pointer C_COM The application was never registered with ysysd Example Global module T_DBUS_Util mt_DBUS_Util sint32 s32_Retval s32_Retval ysysd_cancel_watch_dog mt_DBUS_Util if s32_Retval C_NO_ERR Handle error cases 7 3 4 5 ysysd_get_ignition_status Function Description sint32 ysysd_get_ignition_status const T_DBUS_Util const opt_DBusInstance Returns the current status of the ignition pin from th...

Page 155: ...iginterval Time interval when the ysysd expects to be triggered charn acn_myCMDOnWatchdog 2048 Bash cmd that must be executed by the ysysd in case no trigger signal occurred in time T_DBUS_Util Output Information Return Value Description IGN_OFF Ignition pin is low off IGN_ON Ignition pin is high on C_UNKNOWN_ERR Could not retrieve the ignition status from system daemon C_RANGE Parameter opt_DBusI...

Page 156: ..._DBusInstance T_DBUS_Util holds all D Bus information ou32_DurationSec minimum 1 time in seconds the system should stay alive from now on Structure T_DBUS_Util typedef struct DBusConnection pt_dbus_conn D BUS connection instance charn acn_myNameString 128 Name of the application Don t use any special characters white spaces or new lines charn acn_myVersion 128 Additional value for HELLO signal opt...

Page 157: ...l module T_DBUS_Util mt_DBUS_Util sint32 s32_Retval s32_Retval ysysd_request_stay_alive mt_DBUS_Util 10 if s32_Retval C_NO_ERR Don t start any of the critical work here because we can not trust the system to keep running Do the critical work here the system keeps running ...

Page 158: ... applications and processes the opportunity to define create and delete variable lists via D Bus commands In order to achieve quick response times and a good performance when working with these variables writing and reading will not be handled via D Bus but by the shared memory mechanism A data pool can be generated in two different ways Dynamic mode The data pool will be generated at runtime Stat...

Page 159: ...ll D Bus information opcn_Datapool maximum MAX_DP_NAME_LENGTH pointer to the name of the data pool opcn_List maximum MAX_DP_NAME_LENGTH pointer to the name of the variable that is listed in the data pool opcn_Description maximum MAX_DP_METANAME_LENGTH pointer to the description for the variable list opcn_Creator maximum MAX_DP_METANAME_LENGTH pointer to the name of the creator e g tool or user Str...

Page 160: ...sint32 ydatad_add_variable_to_list const T_DBUS_Util const const opt_DBusInstance const charn const opcn_Datapool const charn const opcn_List const charn const opcn_Name const charn const opcn_Type const charn const opcn_Size const charn const opcn_Unit const charn const opcn_Comment The function adds a variable with the name opcn_Name of the type opcn_Type the size opcn_Size to the specified list...

Page 161: ...wed types UINT8 SINT8 UINT16 SINT16 UINT32 SINT32 FLOAT32 AOBYTE STRING pointer to the type of the variable opcn_Size maximum MAX_DP_SIZE_LENGTH allowed type size UINT8 1 SINT8 1 UINT16 2 SINT16 2 UINT32 4 SINT32 4 FLOAT32 4 AOBYTE sizeof au8_byte STRING strlen acn_string pointer to the size in byte of the type opcn_Unit maximum MAX_DP_METANAME_LENGTH pointer to the user defined unit of the variab...

Page 162: ...iggered charn acn_myCMDOnWatchdog 2048 Bash cmd that must be executed by the ysysd in case no trigger signal occurred in time T_DBUS_Util Output Information Return Value Description C_NO_ERR Function executed without error C_UNKNOWN_ERR Error sending the method call C_COM Error receiving the method call answer C_RANGE Error miss match in variable type and size C_NOACT Error occurs because data poo...

Page 163: ...ure T_DBUS_Util typedef struct DBusConnection pt_dbus_conn D BUS connection instance charn acn_myNameString 128 Name of the application Don t use any special characters white spaces or new lines charn acn_myVersion 128 Additional value for HELLO signal opt charn acn_myStatus 128 Additional value for HELLO signal opt charn acn_myAddInfo 512 Additional value for HELLO signal opt sint32 s32_myTrigint...

Page 164: ... 2 4 ydatad_delete_variable_list Function Description sint32 ydatad_delete_variable_list const T_DBUS_Util const opt_DBusInstance const charn const opcn_Datapool const charn const opcn_List The function deletes the shared memory segment for the named variable list ocn_List and the according variable list file in the data pool ocn_Datapool Information Flow Input Information Parameter Range Descript...

Page 165: ...iggered charn acn_myCMDOnWatchdog 2048 Bash cmd that must be executed by the ysysd in case no trigger signal occurred in time T_DBUS_Util Output Information Return Value Description C_NO_ERR Function executed without error variable list was successfully deleted C_UNKNOWN_ERR Error sending the method call or NULL pointer error C_COM Error receiving the method call answer C_NOACT Error occurred beca...

Page 166: ...Description opcn_BasePath os32_Size pointer to base path Structure T_DBUS_Util typedef struct DBusConnection pt_dbus_conn D BUS connection instance charn acn_myNameString 128 Name of the application Don t use any special characters white spaces or new lines charn acn_myVersion 128 Additional value for HELLO signal opt charn acn_myStatus 128 Additional value for HELLO signal opt charn acn_myAddInfo...

Page 167: ...he data pool have to be initialized After initialization it isn t possible to add more lists to the initialized data pool The ydata daemon creates a file in the named data pool subdirectory with the extension dpi This file contains the information about the created data pool Information Flow Input Information Parameter Range Description opt_DBusInstance T_DBUS_Util holds all D BUS information opcn...

Page 168: ...nter C_COM Error receiving the method call answer C_NOACT Error occurred because the data pool sub directory did not exist or the dpi file already existed C_RANGE Parameter out of range Example Global module T_DBUS_Util mt_DBUS_Util sint32 s32_Retval s32_Retval ydatad_init_datapool mt_DBUS_Util MyDatapool if s32_Retval C_NO_ERR Go on 7 3 5 2 7 ydatad_delete_datapool Function Description sint32 yda...

Page 169: ...ines charn acn_myVersion 128 Additional value for HELLO signal opt charn acn_myStatus 128 Additional value for HELLO signal opt charn acn_myAddInfo 512 Additional value for HELLO signal opt sint32 s32_myTriginterval Time interval when the ysysd expects to be triggered charn acn_myCMDOnWatchdog 2048 Bash cmd that must be executed by the ysysd in case no trigger signal occurred in time T_DBUS_Util O...

Page 170: ...nd if the size is correct If both input values fit the function returns the corresponding variable type index Information Flow Input Information Parameter Range Description opcn_Type allowed types UINT8 SINT8 UINT16 SINT16 UINT32 SINT32 FLOAT32 AOBYTE STRING pointer to the variable type opcn_Size allowed type size UINT8 1 SINT8 1 UINT16 2 SINT16 2 UINT32 4 SINT32 4 FLOAT32 4 AOBYTE sizeof au8_byte...

Page 171: ...E_DataType typedef enum eUNKNOWN 0 eUINT8 eSINT8 eUINT16 eSINT16 eUINT32 eSINT32 eFLOAT32 eAOBYTE eSTRING eNULL E_DataType Output Information Return Value Description eNULL Type is unknown else Type and size is found Returns the variable type index See E_DataType ...

Page 172: ...file Engine dpl ls al opt taf drw r r 2 root root 232 Dec 5 08 21 TestDatpool ls al opt taf TestDatpool rwxr x r x 1 root root 3306 Dec 5 08 21 Engine dpl 7 3 5 3 2 Basic DPL file structure Every data pool list file has the following basic components Necessary DPL file objects Parameter Description CONFIG Start tag of the DPL file NUMOFVARS Number of variables in the DPL file is set by ydatad LIST...

Page 173: ...ize of 4 byte the next variable starts at address number 4 SIZE Size of the variable in byte TYPE Type of the variable UINT8 1 byte SINT8 1 byte UINT16 2 byte SINT16 2 byte UINT32 4 byte SINT32 4 byte FLOAT32 4 byte AOBYTE UINT8 SIZE STRING SINT8 SIZE UNIT Unit of the variable COMMENT Specific comment for the variable Example CONFIG NUMOFVARS 0 LISTNAME ENGINE DESCRIPTION Test List CREATING_PRGM J...

Page 174: ...7 Teleservice Application Framework User Manual 174 374 ADDRESS 6 SIZE 4 TYPE UINT32 UNIT COMMENT EnginePower ...

Page 175: ...s a data structure for each valid data list Afterwards it s possible to use the indexed data pool Information Flow Input Information Parameter Range Description os32_DatapoolIndex 0 maximum of sint32 includes the index of the data pool opcn_Path maximum MAX_DP_BASEFOLDER_LENGHT pointer to the base folder of the data pool Output Information Return Value Description C_NO_ERR Function executed withou...

Page 176: ...ame MyDatapool NULL s32_Retval ydatad_load_datapool u32_i acn_HelpString if s32_Retval C_NO_ERR Error handling 7 3 5 4 2 ydatad_get_number_of_loaded_datapools Function Description sint32 ydatad_get_number_of_loaded_datapools void The function returns the number of loaded data pools Information Flow Output Information Return Value Description 0 Number of loaded data pools 0 No data pools initialize...

Page 177: ...ath maximum MAX_DP_BASEFOLDER_LENGHT pointer to the base folder of the data pools Output Information Return Value Description C_NO_ERR Function executed without error C_UNKNOWN_ERR NULL pointer C_RANGE No data pools available or path size error Example Global module sint32 s32_Retval T_DBUS_Util mt_DBUS_Util charn acn_HelpString MAX_DP_BASEFOLDER_LENGHT s32_Retval ydatad_get_datapool_base_path mt_...

Page 178: ...ol lists T_DATA_LIST_INFO T_DATA_LIST_INFO pt_lists T_DATA_DATAPOOL_INFO typedef struct charn acn_ListName MAX_DP_NAME_LENGTH Name of the list max size 32 charn acn_Description MAX_DP_METANAME_LENGTH Description of list max size of 64 charn acn_CreatingPRGM MAX_DP_METANAME_LENGTH Creator or program name max size of 64 sint32 s32_NbOfVars Number of variables in the list T_DATA_VARIABLE_INFO sint32 ...

Page 179: ..._DATAPOOL_INFO pt_Datapool sint32 s32_Retval uint32 u32_NumberOfDatapools u32_NumberOfDatapools ydatad_get_size_loaded_datapools for uint32 u32_i 0 u32_i s32_NumberOfDatapools u32_i s32_Retval ydatad_get_datapool_info u32_i pt_Datapool if s32_Retval C_NO_ERR Error handling 7 3 5 4 5 ydatad_get_variable_index Function Description sint32 ydatad_get_variable_index const sint32 ops32_DatapoolIndex con...

Page 180: ...Invalid data pool list or variable or variable name out of range Structure T_DATA_VARIABLE_INFO typedef struct charn acn_VarName MAX_DP_NAME_LENGTH Variable name max size of 32 charn acn_Type MAX_DP_TYPENAME_LENGTH Type of variable max size of 10 UINT8 SINT8 UINT16 SINT16 UINT32 SINT32 FLOAT32 AOBYTE STRING E_DataType e_TypeIndex sint32 s32_Size Size of the variable charn acn_Unit MAX_DP_METANAME_...

Page 181: ... variable list index number ops32_DatapoolIndex of the variable list name opcn_VariableListName Information Flow Input Information Parameter Range Description os32_DatapoolIndex 0 maximum of sint32 includes the index of the data pool opcn_VariableListName 1 MAX_DP_NAME_LENGTH pointer to the variable list name Output Information Return Value Description 0 Returns the data pool index number of the n...

Page 182: ... module sint32 s32_DataPoolIndex sint32 s32_ListIndex s32_DataPoolIndex ydatad_get_datapool_index MyDatapool s32_ListIndex ydatad_get_list_index s32_DataPoolIndex GPSDates 7 3 5 4 7 ydatad_set_variable Function Description sint32 ydatad_set_variable const sint32 os32_DatapoolIndex const sint32 os32_VariableListIndex const sint32 os32_VariableIndex const void const opv_Buffer const uint32 ou32_Numb...

Page 183: ...variable does not exist Example Global module sint32 s32_DataPoolIndex sint32 s32_ListIndex sint32 s32_VarIndex float32 f32_Value 5 sint32 s32_Retval s32_DataPoolIndex ydatad_get_datapool_index MyDatapool s32_ListIndex ydatad_get_list_index s32_DataPoolIndex GPSDates s32_VarIndex ydatad_get_variable_index s32_DataPoolIndex s32_ListIndex Longitude s32_Retval ydatad_set_variable s32_DataPoolIndex s3...

Page 184: ...v_Buffer ou32_SizeOfBuffer pointer to the value of the variable Return Value Description C_NO_ERR Function executed without error read value and set it into given buffer was successful C_RANGE Data pool list or variable does not exist Example Global module sint32 s32_DataPoolIndex sint32 s32_ListIndex sint32 s32_VarIndex float32 f32_Value sint32 s32_Retval s32_DataPoolIndex ydatad_get_datapool_ind...

Page 185: ...udes the variable list index os32_VariableIndex 0 maximum of sint32 includes the variable index Output Information Parameter Range Description opt_DataVariableInfo T_DATA_VARIABLE_INFO includes the data variable info Structure T_DATA_VARIABLE_INFO typedef struct charn acn_VarName MAX_DP_NAME_LENGTH Variable name max size of 32 charn acn_Type MAX_DP_TYPENAME_LENGTH Type of variable max size of 10 U...

Page 186: ...dex ydatad_get_variable_index s32_DataPoolIndex s32_ListIndex Logitude s32_Retval ydatad_get_variable_info s32_DataPoolIndex s32_ListIndex s32_VarIndex t_DataVariableInfo if s32_Retval C_NO_ERR Go on 7 3 5 4 10 ydatad_check_update_list Function Description sint32 ydatad_check_update_list const sint32 os32_DatapoolIndex const sint32 os32_VariableListIndex The function checks if at least one entry o...

Page 187: ...he function checks if the variable specified by os32_DatapoolIndex os32_VariableListIndex and os32_VariableIndex has been updated since the last call of ydatad_get_variable Information Flow Input Information Parameter Range Description os32_DatapoolIndex 0 maximum of sint32 includes the data pool index os32_VariableListIndex 0 maximum of sint32 includes the variable list index os32_VariableIndex 0...

Page 188: ...tapoolIndex and os32_VariableListIndex Information Flow Input Information Parameter Range Description os32_DatapoolIndex 0 maximum of sint32 includes the data pool index os32_VariableListIndex 0 maximum of sint32 includes the variable list index os32_VariableIndex 0 maximum of sint32 includes the variable index Output Information Parameter Range Description ops32_VariableIndex returned variable in...

Page 189: ... create static or dynamic logging jobs Dynamic logging mode Each application can add variables that should be logged from the logging job An application can define trigger conditions for these variables that make the daemon write a new data record into the log file Static logging mode A user created data logging configuration file dlc will be used This file will be parsed by the ylogd If no error ...

Page 190: ...7 Teleservice Application Framework User Manual 190 374 How the logger mechanism works ...

Page 191: ...gjob dataset entry a time stamp will be written if ou32_Timestamp is set to TRUE 1 Every ou32_SampleTime milliseconds the logger checks all values if they have changed If they have changed the values will be updated to an internal structure After the trigger time has elapsed the internal structure will be written into the logging file opcn_LogJobName Information Flow Input Information Parameter Ra...

Page 192: ... Information Return Value Description C_NO_ERR Function executed without error job successfully created C_UNKNOWN_ERR Error occurs during sending the method call or NULL pointer C_COM Error occurs during receiving the method call answer C_NOACT Error occurs because logger job name or log file format invalid basic sample interval too short or logger job configuration already exists C_RANGE Paramete...

Page 193: ...rve Type SINT32 Size 4 UNIT DATASTART Time stamp in sec since 2000 Value Value Value Value 540000 28 755 Test 28 56332 First line 540001 Test2 29 Second line ASCII_CSV Log File header TIMESTAMP DP name DPL name Var name Unit DP name DPL name Var name Unit Time stamp Value Value Value Value 23 11 10_10 00 51 159 28 34 230 First Line 23 11 10_10 00 52 150 232 First Line Binary_C2C_LE Log File header...

Page 194: ...ileFormat 5 Comment Test log job for Test MaxSize 10485760 Date Time 22 11 11_13 30 53 FileInfo Timestamp 1 DP 00 Test Lst 00 Engine Var 00 EngineSpeed Type SINT32 Size 4 Unit rpm Var 01 InjectionQuantity Type SINT32 Size 4 Unit mm3 H Var 02 EnginePowerReserve Type SINT32 Size 4 UNIT DATASTART START_TAG uint16 BlockLength uint16 Datainfo uint16 Datum in sec since 1970 uint32 msec uint16 not used D...

Page 195: ...o the log file in case it differs more than ou32_Hysteresis from its previous record Information Flow Input Information Parameter Range Description opt_DBusInstance T_DBUS_Util holds all D Bus information opcn_LogJobName maximum MAX_DL_NAME_LENGTH pointer to log job name opcn_DatapoolName maximum MAX_DP_NAME_LENGTH pointer to the data pool name opcn_ListName maximum MAX_DP_NAME_LENGTH pointer to t...

Page 196: ...ion executed without error variable successfully added to the logger file dlc C_COM D Bus communication error C_UNKNOWN_ERR NULL pointer error or wrong parameters C_NOACT Error occurs because logger job data pool variable list or variable name is invalid received values are corrupt data logger configuration does not exist or is corrupt or logger already initialized C_RANGE Parameters are out of ra...

Page 197: ... FORMATTER_OLDVALUE or FORMATTER_NEWVALUE then those portions of the command will be replaced by the previously logged value and the currently logged value respectively Information Flow Input Information Parameter Range Description opt_DBusInstance T_DBUS_Util holds all D Bus information opcn_LogJobName maximum MAX_DL_NAME_LENGTH pointer to log job name opcn_DatapoolName maximum MAX_DP_NAME_LENGTH...

Page 198: ...nal occurred in time T_DBUS_Util Output Information Return Value Description C_NO_ERR Function executed without error event condition was successfully set C_COM D Bus communication error C_UNKNOWN_ERR NULL pointer error or wrong parameters C_NOACT Error occurs because log job name invalid log job does not exist log job active variable does not exist in data pool cannot update log job C_RANGE Param...

Page 199: ... condition s is are true the trigger time value will be set to ou32_SampleTime until the event condition s is are false The trigger time can be set via the function ylogd_set_trigger_time see ylogd_set_trigger_time on page 200 a condition can be added via the function ylogd_set_event_condition see ylogd_set_save_condition on page 207 and the sample time can be set via the function ylogd_create_log...

Page 200: ...ects to be triggered charn acn_myCMDOnWatchdog 2048 Bash cmd that must be executed by the ysysd in case no trigger signal occurred in time T_DBUS_Util Output Information Return Value Description C_NO_ERR Function executed without error trigger time was activated successfully C_COM D Bus communication error C_UNKNOWN_ERR NULL pointer error C_RANGE ou8_LogMechanism is out of range C_NOACT Error occu...

Page 201: ...s trigger time in ms value has to be sample time parameter from ylogd_create_log_job see ylogd_create_log_job on page 191 Structure T_DBUS_Util typedef struct DBusConnection pt_dbus_conn D BUS connection instance charn acn_myNameString 128 Name of the application Don t use any special characters white spaces or new lines charn acn_myVersion 128 Additional value for HELLO signal opt charn acn_mySta...

Page 202: ...ogger 500 if s32_Retval C_NO_ERR Go on 7 3 6 2 6 ylogd_set_buffered_logging Function Description sint32 ylogd_set_buffered_logging const T_DBUS_Util const opt_DBusInstance const charn const opcn_LogJobName const uint32 ou32_LoggingBufferSize The function sets the number of records to buffer All logging data will be sent to this buffer If the log is triggered with ylogd_trigger_bufferd_log see ylog...

Page 203: ...w lines charn acn_myVersion 128 Additional value for HELLO signal opt charn acn_myStatus 128 Additional value for HELLO signal opt charn acn_myAddInfo 512 Additional value for HELLO signal opt sint32 s32_myTriginterval Time interval when the ysysd expects to be triggered charn acn_myCMDOnWatchdog 2048 Bash cmd that must be executed by the ysysd in case no trigger signal occurred in time T_DBUS_Uti...

Page 204: ...logged opcn_VariableName is the value of opcn_Datapoolname opcn_ListName opcn_VariableName When a master save condition is defined it will always be concatenated with the previous master save conditions result The variable to be tested is defined by opcn_DatapoolName opcn_ListName and opcn_VariableName The testing logic is defined by opcn_Logic which can be The variable is checked against the foll...

Page 205: ... to log opcn_Concatenation maximum MAX_DL_CONC_LENGTH pointer to concatenation options like AND OR and EXOR Structure T_DBUS_Util typedef struct DBusConnection pt_dbus_conn D BUS connection instance charn acn_myNameString 128 Name of the application Don t use any special characters white spaces or new lines charn acn_myVersion 128 Additional value for HELLO signal opt charn acn_myStatus 128 Additi...

Page 206: ... variable list or variable name invalid logic or concatenation operator was invalid received values corrupt data logger configuration does not exist DLC file corrupt or logger already initialized C_RANGE Parameters are out of range Association between logic hysteresis and threshold Example Global module T_DBUS_Util mt_DBUS_Util sint32 s32_Retval s32_Retval ylogd_set_master_save_condition mt_DBUS_U...

Page 207: ...oolName opcn_ListName and opcn_VariableName The testing logic is defined by opcn_Logic which can be The variable is checked against the following parameters os32_Threshold os32_Hysteresis If there are more than one condition set then each condition result will be logically linked with his previous result by opcn_Concatenation AND OR and EXOR Information Flow Input Information Parameter Range Descr...

Page 208: ...myAddInfo 512 Additional value for HELLO signal opt sint32 s32_myTriginterval Time interval when the ysysd expects to be triggered charn acn_myCMDOnWatchdog 2048 Bash cmd that must be executed by the ysysd in case no trigger signal occurred in time T_DBUS_Util Output Information Return Value Description C_NO_ERR Function executed without error event condition was set successfully C_COM D Bus commu...

Page 209: ...09 374 Association between logic hysteresis and threshold Example Global module T_DBUS_Util mt_DBUS_Util sint32 s32_Retval s32_Retval ylogd_set_save_condition mt_DBUS_Util TC3_Logger MyDatapool GPSDates Longitude 5 10 AND if s32_Retval C_NO_ERR Go on ...

Page 210: ... start YYYYMMDDHHmmss STOP time of file stop YYYYMMDDHHmmss EXT dlf or opcn_LogFileExtension gz optional extension if compression is used If the folder size limit is reached the oldest log files in the folder will be removed until the folder size limit is maintained If the destination folder does not exist the system will attempt to create it Information Flow Input Information Parameter Range Desc...

Page 211: ... 128 Additional value for HELLO signal opt charn acn_myAddInfo 512 Additional value for HELLO signal opt sint32 s32_myTriginterval Time interval when the ysysd expects to be triggered charn acn_myCMDOnWatchdog 2048 Bash cmd that must be executed by the ysysd in case no trigger signal occurred in time T_DBUS_Util Output Information Return Value Description C_NO_ERR Function executed without error a...

Page 212: ...TER_FILENAME then that portion of the command will be replaced by the full path name of the created log file Information Flow Input Information Parameter Range Description opt_DBusInstance T_DBUS_Util holds all D Bus information opcn_LogJobName maximum MAX_DL_NAME_LENGTH pointer to log job name opcn_Command maximum MAX_DL_COMMAND_LENGTH pointer to the command to execute Structure T_DBUS_Util typed...

Page 213: ...logger job name is invalid log management has not been configured yet C_RANGE opcn_LogJobName is out of range 7 3 6 2 11 ylogd_activate_log_job Function Description sint32 ylogd_activate_log_job const T_DBUS_Util const opt_DBusInstance const charn const opcn_LogJobName const uint32 ou32_OnOff The function starts ou8_OnOff 0 and stops ou8_OnOff 0 the log job opcn_LogJobName Information Flow Input I...

Page 214: ...d by the ysysd in case no trigger signal occurred in time T_DBUS_Util Output Information Return Value Description C_NO_ERR Function executed without error log job activate successfully C_COM D Bus communication error C_UNKNOWN_ERR Wrong or not existing job C_NOACT Error occurs because logger job name or start stop flag invalid data logger configuration does not exist no data logger running DLC fil...

Page 215: ... MB BASIC_SAMPLE_TIME Time interval in which is checked whether the values have changed TIMESTAMP Time stamp at the beginning of every new logged line in the data logger file FILEHEADER Start tag of the log file COMMENT Comment SAMPLECONDITIONS Start tag of the values which shall be logged chapter NUMCONDITIONS Number of values which shall be logged MASTERSAVECONDITIONS Start of the chapter for ma...

Page 216: ...In EVENT_TRIGGERED mode the TRIGGERTIME will be automatically set to BASIC_SAMPLE_TIME In case of a missing LOG_MECHANISM entry the default behavior is TIME_TRIGGERED TRIGGERTIME Time interval in ms after a new line to the data logger file shall be written if the save conditions are valid NUMSAVECONDITIONS Number of save conditions which must be valid before a line shall be written to the data log...

Page 217: ...TAMP DP name DPL name Var name Unit DP name DPL name Var name Unit Time stamp Value Value Value Value 23 11 10_10 00 51 159 28 34 230 First Line 23 11 10_10 00 52 150 232 First Line Binary_C2C_LE Log File header LOGFILE_HEADER LogFile Test_Logger LogFileFormat 4 Comment Test log job for Test MaxSize 10485760 Date Time 22 11 11_13 30 53 FileInfo Timestamp 1 DP 00 Test Lst 00 Engine Var 00 EngineSpe...

Page 218: ...pe SINT32 Size 4 Unit mm3 H Var 02 EnginePowerReserve Type SINT32 Size 4 UNIT DATASTART START_TAG uint16 BlockLength uint16 Datainfo uint16 Datum in sec since 1970 uint32 msec uint16 not used DP ID uint8 DP List ID uint8 DP List Var ID uint8 Datum Datum Length uint8 Datainfo BIT 0 1 0 time triggered 1 event triggered 2 time or event triggered BIT 2 3 0 no timestamp 1 RTC 2 user defined timestamp B...

Page 219: ...he list which contains the variable name SAVEHYSTERESIS The variable is only written to the datalogger if the value changes since it has been stored for the last time The first dataset in a new file and the first dataset after starting up the device will always contain all variables Example JOBOPTIONS ACTIVE 0 LFJNAME Logger1 LFFORMAT 1 MEMSIZE 1048576 BASIC_SAMPLE_TIME 10 TIMESTAMP 0 FILEHEADER C...

Page 220: ...e name LOGIC HYSTERESIS Hysteresis THRESHOLD Threshold CONCATENATION AND OR XOR Explanation This means that a master save condition is defined that is concatenated with the previous event conditions result A variable to be tested is defined by DATAPOOL LIST and VARIABLENAME The testing logic is defined by LOGIC which can be The value the variable is tested against is defined by THRESHOLD HYSTERESI...

Page 221: ...LE_TIME 10 TIMESTAMP 0 FILEHEADER COMMENT Test log job SAMPLECONDITIONS NUMCONDITIONS 2 SAMPLECONDITION1 NAME Logitude DATAPOOL MyDatapool LIST GPSDates SAVEHYSTERESIS 10 SAMPLECONDITION2 NAME Latitude DATAPOOL MyDatapool LIST GPSDates SAVEHYSTERESIS 10 MASTERSAVECONDITIONS NUMMASTERSAVECONDITIONS 1 MASTERSAVECONDITION1 VARIABLENAME EngineSpeed DATAPOOL MyDatapool LIST Engine LOGIC HYSTERESIS 50 ...

Page 222: ...e save condition variable name LIST Name of the list which contains the save condition variable name LOGIC HYSTERESIS Hysteresis THRESHOLD Threshold CONCATENATION AND OR XOR Explanation This means that a save condition is defined that is concatenated with the previous event conditions result A variable to be tested is defined by DATAPOOL LIST and VARIABLENAME The testing logic is defined by LOGIC ...

Page 223: ...7 Teleservice Application Framework User Manual 223 374 Association between logic hysteresis and threshold ...

Page 224: ...NUMCONDITIONS 2 SAMPLECONDITION1 NAME Logitude DATAPOOL MyDatapool LIST GPSDates SAVEHYSTERESIS 10 SAMPLECONDITION2 NAME Latitude DATAPOOL MyDatapool LIST GPSDates SAVEHYSTERESIS 10 MASTERSAVECONDITIONS NUMMASTERSAVECONDITIONS 0 SAVECONDITIONS LOG_MECHANISM 1 TRIGGERTIME 1000 NUMSAVECONDITIONS 1 SAVECONDITION1 VARIABLENAME EngineSpeed DATAPOOL MyDatapool LIST Engine LOGIC HYSTERESIS 50 THRESHOLD 1...

Page 225: ...erSize Information Flow Input Information Parameter Range Description opt_DBusInstance T_DBUS_Util holds all D Bus information opcn_DataLoggerName maximum MAX_DL_NAME_LENGTH pointer to the name of the datalogger ou16_BufferSize minimum MAX_DL_BASEFOLDER_LENGTH maximum buffer size of datalogger path Structure T_DBUS_Util typedef struct DBusConnection pt_dbus_conn D BUS connection instance charn acn...

Page 226: ...ERR Go on 7 3 6 4 2 ylogd_delete_log_file Function Description sint32 ylogd_delete_log_file const T_DBUS_Util const opt_DBusInstance const charn const opcn_DataLoggerName const uint8 ou8_DeleteAll The function deletes the logger opcn_DataLoggerName The flag ou8_DeleteAll indicates if only the tmp file shall be deleted tmp file is the file which can be used for copying to server or to a extern flas...

Page 227: ...ddInfo 512 Additional value for HELLO signal opt sint32 s32_myTriginterval Time interval when the ysysd expects to be triggered charn acn_myCMDOnWatchdog 2048 Bash cmd that must be executed by the ysysd in case no trigger signal occurred in time T_DBUS_Util Output Information Return Value Description C_NO_ERR file files was were found and deleted C_CONFIG flag parameter not correct C_UNKNOWN_ERR N...

Page 228: ...ypedef struct DBusConnection pt_dbus_conn D BUS connection instance charn acn_myNameString 128 Name of the application Don t use any special characters white spaces or new lines charn acn_myVersion 128 Additional value for HELLO signal opt charn acn_myStatus 128 Additional value for HELLO signal opt charn acn_myAddInfo 512 Additional value for HELLO signal opt sint32 s32_myTriginterval Time interv...

Page 229: ... in the structure opt_DBusGpsData Information Flow Input Information Parameter Range Description opt_DBusInstance T_DBUS_Util holds all D Bus information Structure T_DBUS_Util typedef struct DBusConnection pt_dbus_conn D BUS connection instance charn acn_myNameString 128 Name of the application Don t use any special characters white spaces or new lines charn acn_myVersion 128 Additional value for ...

Page 230: ...low mean sea level in meters charn acn_time 32 hhmmss charn acn_satellites 32 number of satellites used in solution charn acn_quality 32 0 no reception 1 good charn acn_warn 32 V GPS position is not valid A GPS position is valid charn acn_speed 32 Speed over ground km h XXX YYYYYY charn acn_course 32 Degrees 0 360 XXX YYYYYY charn acn_date 32 ddmmyy charn acn_UTC 64 MMDDhhmmYYYY T_DBUS_GPS_Data Re...

Page 231: ...32 ms32_RequestGPSData const T_DBUS_Util const opt_DBusInstance T_DBUS_GPS_Data t_DBus_GPS_Data Call dbus util function if ygpsd_get_gps_data opt_DBusInstance t_DBus_GPS_Data 0 printf Error fetching GPS data n return C_COM To something with the received values return C_NO_ERR ...

Page 232: ...the number opcn_PhoneNumber The SMS is sent after the standard time interval that is set in the configuration file of the SMS daemon The maximum message size is 160 characters Information Flow Input Information Parameter Range Description opt_DBusInstance T_DBUS_Util holds all D Bus information opcn_PhoneNumber maximal MAX_SMS_NUMBER_LENGTH pointer to the phone number buffer opcn_Message 0 MAX_SMS...

Page 233: ...st opt_DBusInstance const charn const opcn_PhoneNumber const charn const opcn_Message The function sends an urgent SMS to the given phone number opcn_PhoneNumber The standard time interval for sending receiving SMS which is set in configuration file is ignored and the SMS will be sent immediately Information Flow Input Information Parameter Range Description opt_DBusInstance T_DBUS_Util holds all ...

Page 234: ...lue Description C_NO_ERR Function executed without error C_UNKNOWN_ERR NULL pointer or memory error C_COM D Bus communication error C_RANGE Invalid SMS or phone number length Example sint32 s32_Retval C_NO_ERR T_DBUS_Util mt_DBUS_Util s32_Retval ysmsd_send_sms_urgent mt_DBUS_Util 017612341234 Hello World if s32_Retval C_NO_ERR Go on 7 3 8 4 ysmsd_request_sms_fetch_urgent Function Description sint3...

Page 235: ...acn_myAddInfo 512 Additional value for HELLO signal opt sint32 s32_myTriginterval Time interval when the ysysd expects to be triggered charn acn_myCMDOnWatchdog 2048 Bash cmd that must be executed by the ysysd in case no trigger signal occurred in time T_DBUS_Util Output Information Return Value Description C_NO_ERR Function executed without error C_UNKNOWN_ERR NULL pointer or memory error C_COM D...

Page 236: ..._initialize_request_callbacks see dbus_initialize_request_callbacks on page 144 7 3 9 2 ynetworkd_get_connected_interface Function Description sint32 ynetworkd_get_connected_interface const T_DBUS_Util const opt_DBusInstance charn const opcn_ConnectedInterface const uint8 ou8_BufferSize The function returns the name of the actual connected interface Information Flow Input Information Parameter Ran...

Page 237: ...2_Retval ynetworkd_get_connected_interface mt_DBUS_Util au8_Name sizeof au8_Name if s32_Retval C_NO_ERR Go on 7 3 9 3 ynetworkd_start_connection Function Description sint32 ynetworkd_start_connection const T_DBUS_Util const opt_DBusInstance const uint32 ou32_ConTime The function turns ynetworkd into connectivity mode for ou32_ConTime seconds After ou32_ConTime seconds without a recall of the funct...

Page 238: ...LLO signal opt sint32 s32_myTriginterval Time interval when the ysysd expects to be triggered charn acn_myCMDOnWatchdog 2048 Bash cmd that must be executed by the ysysd in case no trigger signal occurred in time T_DBUS_Util Output Information Return Value Description C_NO_ERR No error function runs successful C_COM D BUS communication error C_NOACT Error occurs because of invalid arguments or conn...

Page 239: ...ion instance charn acn_myNameString 128 Name of the application Don t use any special characters white spaces or new lines charn acn_myVersion 128 Additional value for HELLO signal opt charn acn_myStatus 128 Additional value for HELLO signal opt charn acn_myAddInfo 512 Additional value for HELLO signal opt sint32 s32_myTriginterval Time interval when the ysysd expects to be triggered charn acn_myC...

Page 240: ...7 Teleservice Application Framework User Manual 240 374 Example sint32 s32_Retval C_NO_ERR T_DBUS_Util mt_DBUS_Util s32_Retval ynetworkd_stop_connection mt_DBUS_Util if s32_Retval C_NO_ERR Go on ...

Page 241: ... and a GPRS communication server GPRS ComServer If not included in a data section the parameters are stored in ASCII format in the NextJob job file FWSW Set wakeup cycle time Syntax of command FWSW wakeup_cycle Syntax of response FWSW error_code Description Set a new wakeup cycle time At this interval the TC1 requests a new NextJob job from the ComServer Parameter Input Variable Variable Type Desc...

Page 242: ...fied data logger log file Starts with first_dataset Log file data can be deleted after reading is finished Parameter Input Variable Variable Type Description name string Name of data logger max 16 char format string If H get info header 1 2 comment data If N get log file name data clear string If C clear data logger content first_dataset uint32 First data set number to be read Output Variable Vari...

Page 243: ...8_name 16 u16_var_index_1 u16_var_index_2 u16_var_index_n 0x0000 Syntax of response KFGV error_code ASCII mode Binary mode Description Reads a list of variables Two formats of the command are supported In ASCII mode var_index_n is ASCII coded In binary mode the variable index are transferred binary in a data section This allows to reduce the traffic volume compared to the ASCII format The raw data...

Page 244: ..._n u16_var_index_n au8_value_n m 0x0000 Syntax of response KFSV error_code ASCII mode Binary mode Description Writes a list of variables Two formats are supported In ASCII mode var_index_n and value_n are ASCII coded Only int8 int16 and int32 types are supported The length is not included in the command of this format It is determined by the variable index In binary mode var_index_n and value_n ar...

Page 245: ... Output Variable Variable Type Description error_code uint16 0 no error occurred else command failed DLTS Datalogger transmission size Syntax of command DLTS transmission size in bytes Syntax of response DLTS error_code Description Set the maximum transmission size before a result xxx end file is created The default value is 0 In that case the logger will transmit all logged data before a end file...

Page 246: ...Tag don t edit response 0 Don t wait for D Bus response always answer with OK in the job file 1 Wait for D Bus answer with a maximum wait time of 5 seconds After timeout the job file will be automatically answered with an error destination D Bus name of the application which receives the message If the destination address is empty the message is automatically send as a broadcast message with no wa...

Page 247: ...ucture T_DBUS_Util typedef struct DBusConnection pt_dbus_conn D BUS connection instance charn acn_myNameString 128 Name of the application Don t use any special characters white spaces or new lines charn acn_myVersion 128 Additional value for HELLO signal opt charn acn_myStatus 128 Additional value for HELLO signal opt charn acn_myAddInfo 512 Additional value for HELLO signal opt sint32 s32_myTrig...

Page 248: ...state via D Bus To be able to use this function the UseExternalInternetState must be set to true UseExternalInternetState can be configured in the configuration file ysignald config of the ysignal daemon see Signal daemon on page 108 Information Flow Input Information Parameter Range Description opt_DBusInstance T_DBUS_Util holds all D BUS information opcn_SignalArgument ETH WLAN PPP NotConnected ...

Page 249: ...yTriginterval Time interval when the ysysd expects to be triggered charn acn_myCMDOnWatchdog 2048 Bash cmd that must be executed by the ysysd in case no trigger signal occurred in time T_DBUS_Util Output Information Return Value Description C_NO_ERR No error function runs successful C_COM Communicated wrong signal state C_RANGE Some of the function arguments are NULL pointer Example Register with ...

Page 250: ...zes received valid GPS data signalizes no valid GPS data received Structure T_DBUS_Util typedef struct DBusConnection pt_dbus_conn D BUS connection instance charn acn_myNameString 128 Name of the application Don t use any special characters white spaces or new lines charn acn_myVersion 128 Additional value for HELLO signal opt charn acn_myStatus 128 Additional value for HELLO signal opt charn acn_...

Page 251: ... Register with D BUS if dbus_get_on_the_bus mt_dbus_util 0 Register application on D BUS failed return 1 send dbus signal s32_retval ysignald_GPS_con_state mt_dbus_util Valid if s32_retval C_NO_ERR Sending GPS_Connection_State signal with state Valid faild return 1 ...

Page 252: ...ormation Parameter Range Description opcn_Path pointer to the name of the directory we want to create ocn_Mode mode_t S_IRUSR S_IWUSR S_IXUSR S_IRGRP S_IWGRP S_IXGRP S_IROTH S_IWOTH S_IXOTH S_ISUID S_ISGID S_ISVTX S_IRWXU is the bitwise OR of S_IRUSR S_IWUSR and S_IXUSR S_IRWXG is the bitwise OR of S_IRGRP S_IWGRP and S_IXGRP S_IRWXO is the bitwise OR of S_IROTH S_IWOTH and S_IXOTH Output Informat...

Page 253: ...tput Information Return Value Description C_NO_ERR Function executed without error The directory was removed successfulyl if directory is incorrect nothing happen 7 3 12 3 utils_file_exists Function Description sint32 utils_file_exists const charn const opcn_FileName The function verifies if the file opcn_FileName exists in the current folder Information Flow Input Information Parameter Range Desc...

Page 254: ...me pointer to regular file name we expect to find Output Information Return Value Description 1 The regular file exists 0 The regular file does not exist 7 3 12 5 utils_directory_exists Function Description sint32 utils_directory_exists const charn const opcn_DirName The function verifies if the directory opcn_DirName exists Information Flow Input Information Parameter Range Description opcn_DirNa...

Page 255: ...er to name of the link to check Output Information Return Value Description 1 The link exists 0 The link does not exist 7 3 12 7 utils_socket_exists Function Description sint32 utils_socket_exists const charn const opcn_SocketName The function verifies if the socket opcn_SocketName exists in the current folder Information Flow Input Information Parameter Range Description opcn_SocketName pointer t...

Page 256: ... exists 0 The FIFO does not exist 7 3 12 9 utils_strlcpy Function Description sint32 s32_strlcpy charn opcn_Destiny const charn opcn_Source sint32 os32_Size The function copies opcn_Source to opcn_Destiny The maximum length of the opcn_Source is os32_Size Information Flow Input Information Parameter Range Description opcn_Source ou32_Size contains the pointer to source os32_Size uint32 contains th...

Page 257: ... string opcn_ValueTargetBufferSize pointer to the buffer size of the value Output Information Return Value Description C_NO_ERR Function executed without error the search string is found and the value is written to the buffer C_UNKNOWN_ERR No search string was found the buffer is too small or can not allocate the buffer 7 3 12 11 utils_search_next_value Function Description sint32 utils_search_nex...

Page 258: ...und buffer too small or couldn t allocate buffer 7 3 12 12 utils_open_log_file Function Description sint32 utils_open_log_file charn opcn_FileName The function opens or creates the log file opcn_FileName Information Flow Input Information Parameter Range Description opcn_FileName pointer to file name Output Information Return Value Description C_NO_ERR The file was opened or created C_UNKNOWN_ERR ...

Page 259: ...on Parameter Range Description opcn_LogString includes the log string Output Information Return Value Description C_NO_ERR Function executed without error Example if utils_open_log_file var run log C_NO_ERR void utils_log_print Test void utils_log_close 7 3 12 14 utils_log_close Function Description sint32 utils_log_close void The function closes the log file Information Flow Output Information Re...

Page 260: ...ONFIG Null pointer C_UNKNOWN_ERR the file can not be deleted 7 3 12 16 utils_init_semaphore Function Description sint32 utils_init_semaphore key_t const osn_SHMKey const uint32 ou32_SemCounter sint32 const ops32_SemID The function initializes the semaphore with the ID ops32_SemID If the semaphore already exists the semaphore ID of this existing semaphore will be returned Information Flow Input Inf...

Page 261: ...tion Description sint32 utils_semaphore_remove const sint32 os32_SemID The function removes the semaphore specified by the Id os32_SemID Information Flow Input Information Parameter Range Description os32_SemID semaphore ID Output Information Return Value Description C_NO_ERR Function executed without error a semaphore ID was successful removed C_CONFIG Cannot remove semaphore 7 3 12 18 utils_sema...

Page 262: ...phore key 7 3 12 19 utils_semaphore_lock Function Description sint32 utils_semaphore_lock const sint32 os32_SemID const uint8 ou8_Mode The function locks the created semaphore with the ID os32_SemID Use this function before entering a critical section Information Flow Input Information Parameter Range Description os32_SemID includes the semaphore ID ou8_Mode 0 1 0 Wait until it is possible to acce...

Page 263: ...D includes the semaphore ID ou8_Mode 0 1 0 Wait until it is possible to access the critical section 1 No waiting If it is not possible to enter the section return with an error Output Information Return Value Description C_NO_ERR Function executed without error C_CONFIG The semaphore ID is smaller than zero C_NOACT The function can not unlock the semaphore with the given ID os32_SemID 7 3 12 21 ut...

Page 264: ...ge Description opt_File contains the file name to that the string must be written to opcn_String contains the string that must be added to the file Output Information Return Value Description C_NO_ERR Function executed without error C_CONFIG The string could not be written to the end of the file 7 3 12 23 utils_get_time_sig Function Description sint32 utils_get_time_sig charn const opcn_Time The f...

Page 265: ...e and date as a string into opcn_Time Information Flow Output Information Parameter Range Description opcn_Time contains local time Return Value Description charn pointer to opcn_Time 7 3 12 25 utils_get_GM_time Function Description charn utils_get_GM_time charn const opcn_Time The function writes the current UTC time and date as a string into opcn_Time Information Flow Output Information Paramete...

Page 266: ... scaled in milliseconds Information Flow Output Information Return Value Description uint32 Up time in milliseconds 7 3 12 27 utils_open_dir Function Description void utils_open_dir const charn const opcn_Path The function opens a directory for reading Information Flow Input Information Parameter Range Description opcn_Path Directory path Output Information Return Value Description NULL Directory ...

Page 267: ...ir void const opv_DirHandle const charn const opcn_Match charn const opcn_FileName The function returns the next file opcn_FileName that contains the string opcn_Match from the directory opv_DirHandle Information Flow Input Information Parameter Range Description opv_DirHandle Directory handle opcn_Match Match pattern NULL or all files Output Information Return Value Description C_NO_ERR Function ...

Page 268: ...lications If you want to extend the skeleton by an own application just copy the files and binaries in the desired folder e g usr local bin To update the TC1 use the result file for further information see chapter Update the Device see Update the Device on page 307 For how to adapt the root file skeleton with own scripts and applications see chapter Adapt the root file skeleton see Adapt the root ...

Page 269: ...Update the STW rootfs version menuconfig Set STW Version 6 Save and exit menuconfig 7 Build the rootfs with the changed configuration bat buildscripts do_make 8 Test the new rootfs by updating the TC1 see chapter Update the Device see Update the Device on page 307 9 Set the new configuration to be the default configuration bat buildscripts do_savedefconfig Root file system version management The S...

Page 270: ...udo apt get install libssl dev sudo apt get install libncurses5 dev for the 64bit version additionally install sudo apt get install lib32stdc 6 sudo apt get install lib32z1 sudo apt get 3 Extract the customer BR The following commands unzips the customer BR into a folder 4 Test your setup In order to work with the customer BR the setup should be tested The easiest way to do that is to build the BR...

Page 271: ...own application just copy the files and binaries in the desired folder for example usr local bin In order to build the root file system with the modifications the do_make_all script needs to be executed 8 1 3 Enable or Disable Buildroot Packages In order to change the configuration of the root file system e g enable or disable certain packages it should be built with default settings first do_make...

Page 272: ... buildscripts do_menuconfig Inside the configuration menu it is possible to navigate through the sub menus and activate or deactivate the desired packages Use the search function if you know the name of the package Open the search mask with like vi insert the package name and press ENTER ...

Page 273: ...8 Development Tools User Manual 273 374 The results will be displayed Location shows the path to the searched package In this case Top level Package Selection for the target Libraries JSON XML ...

Page 274: ...ave the changes when leaving the menuconfig When the build script do_make is executed next it will create a root file system with the new configurations NOTE do_make_all will overwrite the buildroot and busybox configuration with the target defconfig To store the menuconfig settings permanently use do_savedefconfig After that the do_make_all script will use the updated configuration ...

Page 275: ... also be done directly in the buildroot project folder libs br_pjt by using the Linux make command do_defconfig Call buildroot make defconfig file to apply the buildroot configuration The script overwrites the current config file of the buildroot do_menuconfig The script opens the menuconfig setup menu to change the buildroot configuration do_savedefconfig The script saves the current buildroot co...

Page 276: ...t deletes all files generated during the build process do_busybox_menuconfig The script opens the busybox menuconfig setup menue to change its configuration This only works after the rootfs has been built The busybox package must have been unzipped into the output folder do_busybox_savedefconfig The script saves the current busybox configuration to the target busybox defconfig file target_config T...

Page 277: ...are basically two ways to compile a program Using the IDE This is a comfortable way that uses the CodeBlocks IDE Using the shell This is the classic way to compile a program It uses the shell and a make file or directly the cross compiler gcc In this chapter both paths are described 8 2 1 Create New Project Create a practical directory structure for the new project Folder for source files for the ...

Page 278: ...4 Start the CodeBlocks IDE Menu File new project Pick the empty project Click Go The empty project wizard will pop up Click Next Specify the name of the project the directory for the project file and the name of the project file Click Next ...

Page 279: ...folder Click Finish The new project will be created with the following project tree Project directory test test pjt This folder contains the project files test result TC1 This folder contains the compiled output file The new project shall be displayed in the Project Management area ...

Page 280: ...f the project and create a new file main c Add the file to the project Right mouse click on the project symbol in the project management area in CodeBlocks and click on Add files Select the main c file in the source directory and click on open Now it is possible to fold up the directory structure of the Hello World project in the management area Double click on the main c file The edit window pops...

Page 281: ...r n return 0 Your file appears as follows in the IDE Click Rebuild Code Blocks compiles and links all necessary components and creates an executable file in the output directory Copy the file to the device for example over NFS see NFS on page 315 Copy file via NFS Note Don t forget to mount the directories on Host PC and TC1 ...

Page 282: ...nly have one or two source files the classic way using the gcc compiler directly is faster than using the Code Blocks IDE Create a source file that shall be compiled Add following source snip include stdio h int main void printf Hello World r n return 0 Now save the file and create an executable file Therefor use the STW cross compiler ...

Page 283: ...he second one is the output file Copy the output file via USB stick or NFS see NFS on page 315 to device After executing the application you should get the following output NOTE Compiling in command line is possible after installing the DevKit see Install the Toolchain on page 284 ...

Page 284: ...torial to install the toolchain on a 32 64 Bit replace_me Var_Operating_System System NOTE STW supports and recommends Ubuntu 14 04 LTS for developing This operating system has been tested and is 100 compatible with the TC1 development kit All other linux based operating systems are neither recommended nor supported for TC1 development ...

Page 285: ...shell to use the toolchain 32 64 Bit To use the toolchain under the shell set the environmental variables Open the bashrc file sudo gedit bashrc 4 Add the following lines at the end of file Export the Environment variable for the ppc export CROSS_COMPILE powerpc stw linux uclibc export PATH opt powerpc gcc 4 4 3 uclib bin opt powerpc gcc 4 4 3 uclib bin PATH export ARCH powerpc Save the changes an...

Page 286: ...xecutables for the TC1 Especially for larger projects Code Blocks is recommended since it provides a good overview over your software modules to be used If you want to install Code Blocks go to the synaptic package manager of Linux Ubuntu 1 Open the Ubuntu Software Center Dash Home Ubuntu Software Center 2 Click Install and follow the instructions on the screen 3 Open the Code Blocks IDE from the ...

Page 287: ...8 Development Tools User Manual 287 374 8 3 1 3 Setup the Code Blocks IDE After Code Blocks has been installed on your PC it must be configured so that it can be used with the TC1 ...

Page 288: ...te to the tab Compiler settings Other option 5 Enter in the tab Other options the following lines O2 Wall Wno parentheses fno strict aliasing DPF_CAN 29 DAF_CAN PF_CAN 6 Since many applications need access to the CAN Bus add the following defines to your build options Select the tab defines in the tab Compiler settings Enter following line and click OK PF_CAN 29 AF_CAN PF_CAN ...

Page 289: ...8 Development Tools User Manual 289 374 7 Navigate to the tab Toolchain executables and enter in Compilers s installation directory the following line opt powerpc gcc 4 4 3 uclib ...

Page 290: ...rpc stw linux uclibc gcc C compiler powerpc stw linux uclibc c Linker for dynamic libs powerpc stw linux uclibc g Linker for static libs powerpc stw linux uclibc ar Debugger powerpc stw linux uclibc gdb Make program make 9 Click Set As Default to set the settings for the default settings 10 Click OK to accept the changes ...

Page 291: ...g It is possible to use the GNU Debugger to debug applications under Linux The description of the GNU Debugger GDB is in combination with Code Blocks No additional software is needed How to prepare debugging Precondition The toolchain and the IDE CodeBlocks is installed and set up ...

Page 292: ... system you need to install lib32ncurses5 For 32 bit operation systems this step can be skipped To install the library via command line use sudo apt get install lib32ncurses5 2 Check the Code Blocks Compiler Settings The CodeBlocks Compiler Settings have to look like this ...

Page 293: ...8 Development Tools User Manual 293 374 3 Adapt the Build Options in order to build the binary with debug symbols ...

Page 294: ...4 In the main menu select Project Properties Debugger and set up the remote connection settings Serial port stays empty Baud 115200 IP address the IP adresse of your TC1 Port 9090 5 In the main menu select Settings Debugger and go to Default ...

Page 295: ...for example the NFS see NFS on page 315 or if available use an USB drive 8 Start the gdbserver on the TC1 with your application e g ysignald gdbserver 9090 ysignald Process ysignald created pid 1436 Listening on port 9090 9 Start the debugging in Code Blocks Debug Target s default Debug Start Continue F8 Continue with Create Own Application see Create Own Application on page 277 ...

Page 296: ...tivity net ESX TC1 DeploymentPackage_vX_XXrX devkit_vX_XXrX toolchain windows gcc_4_4_3 2 Download the add on installer from STW FTP server URL ftp stw connectivity net see ftp stw connectivity net ftp stw connectivity net ESX TC1 DeploymentPackage_vX_XXrX devkit_vX_XXrX toolchain windows gcc_4_4_3_Add ons 3 Execute the installer 4 Execute the toolchain installer Setup exe binary and follow the in...

Page 297: ... modules to be used 1 Download the Code Blocks IDE from STW FTP server URL ftp stw connectivity net see ftp stw connectivity net ftp stw connectivity net ESX TC1 DeploymentPackage_vX_XXrX devkit_vX_XXrX toolchain windows CodeBlocks 2 Execute the IDE installer Setup exe binary and follow the instructions on the screen 8 3 2 3 Setup the Code Blocks IDE After Code Blocks has been installed on your PC...

Page 298: ... Navigate to the Tab Toolchain executables 5 Select the Compiler s installation directory Set the path depending where Code Bloccks is installed On a 64 bit system Code BLocks is installed in Program Files x86 6 Set the files in the tab Program Files like in the following compiler settings 7 Click OK to accept the changes 8 In the main menu select Project Build options ...

Page 299: ...g_v1_00r0 10 Go to the tab Linker settings 11 Enter in the field Link libraries dbus 1 This links the D Bus library rt This links the run time library taf This links the Teleservice Application Framework library 12 Enter in the field Other linker options the following line For a 32 bit system sysroot C Program Files STW PowerPC GCC stw linux uclib_powerpc_add ons 4_4_3 esx tc3g_v1_00r0 For a 46 bi...

Page 300: ...r for Debugging Use the GNU Debugger to debug applications under Windows The description of the GNU Debugger GDB is in combination with the Code Blocks IDE No additional software is needed Precondition The toolchain and the Code Blocks IDE is installed and configured ...

Page 301: ...8 Development Tools User Manual 301 374 How to prepare debugging 1 Check the Code Blocks Compiler Settings The CodeBlocks Compiler Settings have to look like this ...

Page 302: ...8 Development Tools User Manual 302 374 2 Adapt the Build Options in order to build the binary with debug symbols ...

Page 303: ...3 In the main menu select Project Properties Debugger and set up the remote connection settings Serial port stays empty Baud 115200 IP address the IP adresse of your TC1 Port 9090 4 In the main menu select Settings Debugger and go to Default ...

Page 304: ...uclibc 0 9 33 2 bin powerpc stw linux uclibc gdb exe 6 Make the built binary accessible from the TC1 Use for example the NFS see NFS on page 315 or if available use an USB drive 7 Start the gdbserver on the TC1 with your application e g ysignald gdbserver 9090 ysignald Process ysignald created pid 1436 Listening on port 9090 8 In CodeBlocks choose the GDB debugger ...

Page 305: ...is example project describes how to use CAN beeper motion temperature sensor Folder structure of this Code Blocks example project Folder name Definition of files doc Additional information to the project libs External libraries which are necessary to compile the project or sub projects pjt Contains the CodeBlock project result Executable output files src Contains all header and source files for th...

Page 306: ...e functionality of your application with the possibility to perform HTTP queries like post and get For further information please refer to the http_lib h CANopen The libraries provide an easy way to access and communicate with slave nodes like I O extension modules STW devices DIOS library This library provides higher level functions to interact with ESX DIOS and ESX DIOM modules IOX library This ...

Page 307: ...erminal program for Windows tc1_updater_for_linux Executable which starts the Linux update process tc1_updater_for_windows bat Executable which starts the Windows update process tc1_updater log Log file of the update procedure Appears after an update config ttl General settings for the update process readme Help file How to update the TC1 To perform an update follow the steps 1 Customize the confi...

Page 308: ...ically attached to when the system is booted up for example during start up A filesystem is a hierarchy of directories also referred to as a directory tree that is used to organize files on a computer system On Linux and and other Unix like operating systems the directories start with the root directory which contains a number of subdirectories which can contain more subdirectories Flattened Devic...

Page 309: ...e via TFTP the network settings of the config ttl file needs to be completed for example set the IP address set the network mask b Update via RS232 download Set VarTftpDownload 0 The Update via RS232 is not recommended because it will take a very long time 4 Select the components that shall be updated a Go to the sub section Components to be installed By default all components are set to 1 and wil...

Page 310: ...newer Over the GUI the components for the updated can be selected The settings for the update are stored in the configuration file config ttl The Linux updater provides the possibility to update over USB when a USB device is available on the board WARNING Do not interrupt the update process If the update process is interrupted during the update of the U Boot component it is not possible to access ...

Page 311: ...the update process super user permissions are mandatory Therefore the updater will ask for the sudo password How to test the RS232 connection 1 Open a terminal program on the host PC for example Hyperterm or the TeraTerm that is supplied in the tterm folder 2 Setup the serial port where the device is connected to the following settings a 115200 baud b 1 stop bit c no parity bit d no handshake 3 Sw...

Page 312: ...editor of your choice 2 Set the update source a Update via TFTP download Set VarTftpDownload 1 In case of an update via TFTP the network settings of the config ttl file needs to be completed for example set the IP address set the network mask b Update via RS232 download Set VarTftpDownload 0 The Update via RS232 is not recommended because it will take a very long time 3 Configure the status of the...

Page 313: ...or_linux n starts the updater without the GUI uses the configuration from the config ttl file user pc name tc1_updater_for_linux h prints a short help showing all possible parameters WARNING Do not interrupt the update process If the update process is interrupted during the update of the U Boot component it is not possible to access the board from an external interface any more In this case the co...

Page 314: ...serial interface Use a serial straight through cable to connect the TC1 with your PC Depending on the used operating system on the used PC for development a RS232 terminal must be installed Recommended programs for a RS232 terminal GtkTerm for computers using a Linux operating system Tera Term for Windows desktop PCs GtkTerm used for RS232 terminal program ...

Page 315: ...pd tftp Create etc xinetd d tftp and add the following service tftp protocol udp port 69 socket_type dgram wait yes user root server usr sbin in tftpd server_args tftpboot disable no Make tftpboot directory sudo mkdir tftpboot sudo chmod R 777 tftpboot sudo chown R root tftpboot Start tftpd through xinetd sudo etc init d xinetd restart 10 1 3 NFS The root file system of the TC1 as well as data tra...

Page 316: ...ssary every time the exports file is edited sudo exportfs ra Restart Services The NFS Kernel Server requires a restart sudo etc init d nfs kernel server restart On the device module Mount folder on TC1 mount nfs 192 168 10 101 home user com_nfs mnt com_nfs Now the folder with all files and subdirectories of the host PC home user com_nfs is mounted to mnt com_nfs on the TC1 device 192 168 10 101 is...

Page 317: ...st log in to the TC1 or to apply changes You can simply use TELNET Telnet is supported by Linux Macintosh even Microsoft In order to login to the TC1 start a terminal on any computer Macintosh Linux MS which is connected via Ethernet to the same network as the TC1 Switch on the TC1 and wait for it approximately 10 to 30 seconds to fully boot up Type telnet tc1 IP address Example telnet 192 168 10 ...

Page 318: ...e sure the current does not exceed 400 mA The output can be switched ON OFF over the driver interface with the following command echo 1 proc stw_io PIN1 To turn ON the output use command echo 0 proc stw_io PIN1 To turn OFF the output use command cat proc stw_io PIN1 To read back this output Digital Input This digital input has a built in 10kOhm pull down resistor and a threshold Voltage of 3 5V Si...

Page 319: ... the rubber casket from the SIM card slot 3 Do not use any sharp instruments that can damage the green yellow button Use a pointed pin like a pen to push the green yellow button next to the tray to unlock the SIM card tray 4 Take out the SIM card tray and insert your SIM card 5 Inserting the SIM card tray with the inserted SIM card into the slot Make sure to insert the SIM card tray running rails ...

Page 320: ...perated with The following table shall give an overview of maximum CAN bus length according to the used Baud rate Baud Rate kbit s CAN bus length 1000 1MBit s 20m 500 100 250 250 125 500 50 1000 20 2500 10 5000 Drop line length Drop lines are allowed but should be avoided as they typically create signal echo Drop lines must not be terminated with 120 Ohm resistors The following table shows the max...

Page 321: ...terface is up and can be discoverd RX bytes 1339895 acl 7679 sco 0 events 1891 errors 0 TX bytes 31463 acl 1568 sco 0 commands 152 errors 0 On success The line UP RUNNING PSCAN ISCAN indicates that the interface is up and discoverable On failure Open and initialize the Bluethooth interface hciconfig hci0 up Enable page and inquiry scan of the Bluethooth interface hciconfig hci0 piscan Serial Conne...

Page 322: ...F A6 Now the device rfcomm2 can be seen in the dev directory ls al dev grep rfcomm2 crw rw 1 root root 216 2 Jan 12 02 28 rfcomm2 Open the connection via picocom picocom b 115200 dev rfcomm2 In case of success after some seconds you can see the terminal prompt of the connected device picocom v1 6 port is dev rfcomm2 flowcontrol none baudrate is 115200 parity is none databits are 8 escape is C a lo...

Page 323: ...r over Bluetooth Scan for the needed Bluetooth device hcitool scan Scanning 00 07 80 57 BF A6 TC1 141231231003 00 15 83 41 79 8D Notebook_1 CC 52 AF 05 BF 0D Smartphone_xyz In this example the the module TC1 141231231003 was found and is used to send or receive files via ftp Check if it is possible to send or receive files via ftp Use the command sdptool to perform the check The command sdptool pr...

Page 324: ...fied 19700105T033647Z created 19700105T033647Z accessed 19700105T033720Z file name apn setting size 96 user perm RWD modified 19700105T032939Z created 19700105T032939Z accessed 19700105T032939Z file name sdruntime size 2 user perm RWD modified 19700105T032926Z created 19700105T032926Z accessed 19700105T032926Z file name wakeup size 4 user perm RWD modified 19700105T032926Z created 19700105T032926Z...

Page 325: ... gmail com INBOX set password example imap gmail com 123456 set imap use starttls set from TC3G example gmail com set replyto example gmail com set sender example gmail com set smtp use starttls set ssl verify ignore set smtp smtp smtp gmail com 587 set smtp auth login set smtp auth user example gmail com set smtp auth password 123456 address book alias developer1 developer number1 test de Sending...

Page 326: ... run taf Datapools p dp_name dp_list dp_var Print only a specific datapool list or variable s dp_name dp_list dp_var value datapool_path Set specific value to dp_var datapool_path is optional x Print a list of all datapools with detailed information z Print a list of all datapools with more dedetailed information EXAMPLES Print all datapools found under var run taf Datapools stw_dptool a Print all...

Page 327: ...hmmss charn acn_satellites 32 number of satellites used in solution charn acn_quality 32 0 no reception 1 good charn acn_warn 32 V GPS position is not valid A GPS position is valid charn acn_speed 32 Speed over ground km h XXX YYYYYY charn acn_course 32 Degrees 0 360 XXX YYYYYY charn acn_date 32 ddmmyy charn acn_UTC 64 MMDDhhmmYYYY T_DBUS_GPS_Data Therefore the ygpsd needs to be up and running The...

Page 328: ...ads the acceleration values of the internal motion sensor of the device It is necessary for the tool to work that the FIFO mode is enabled The motion sensor could be adapted via its config file control cat sys bus i2c devices 0 0018 control power on on off powermode normal normal low_power fifomode stream off fifo stream bypass datarate 100Hz 1Hz 10Hz 25Hz 50Hz 100Hz 200Hz 400Hz 1 25kHz 1 6kHz 5kH...

Page 329: ...Hz 25Hz 50Hz 100Hz 200Hz 400Hz 1 25kHz 1 6kHz 5kHz scale 2g 2g 4g 8g 16g setting default wakeup default wakeup_threshold 05 default 10 05 101 Sample quantity 10 Sleeptime us 16666 X Y Z 4 312 1004 0 308 1008 4 304 1004 4 304 1004 8 312 1008 4 320 1012 4 304 1004 8 292 1028 4 316 1032 4 288 1040 11 4 stw_acc2can NAME acc2can acceleration sensor to can SYNOPSIS acc2can h v m d c CAN_BUS msg_id msg i...

Page 330: ...F msg_int Interval of CAN Message to send in msec Default value 1000 Allowed values 10 sample_rate ACC sample rate in msec Shall be greater or equal msg_int Default value 500 Allowed value 10 and 1000 agg_type Aggregation to use If aggregation is selected only the maximum absolute value is sent via CAN The aggregation time is defined via the CAN message send interval The sample rate defines the up...

Page 331: ...ps port all GPGGA 133935 000 4751 7594 N 01037 8708 E 1 6 1 86 688 1 M 47 9 M 5C GPGGA GPGGA 5c 5c 0 GPGGA 1 133935 000 2 4751 7594 3 N 4 01037 8708 5 E 6 1 7 6 8 1 86 9 688 1 10 M 11 47 9 12 M 13 14 5C GPRMC 133935 000 A 4751 7594 N 01037 8708 E 2 42 221 84 190716 A 6B GPRMC GPRMC 6b 6b 0 GPRMC 1 133935 000 2 A 3 4751 7594 4 N 5 01037 8708 6 E 7 2 42 8 221 84 9 190716 10 11 12 A 6B Latitude 47 86...

Page 332: ...er flashing has finished With action in NODE_RETURN 1 start application NODE_RESET 2 reset node NODE_SLEEP 3 go back to sleep mode NET_START 4 start all nodes NET_RESET 5 reset all nodes NONE 6 no action DEFAULT c can index Set which CAN interface to use default is 0 DEPRECATED option prefer i instead i CAN interface Specify CAN interface name e g can0 Example WinFlash ini CONFIG1 BITRATE 125 STAR...

Page 333: ...MPLES stw_SendSMS 016012345678 This could be your text The text This could be your text is send to 016012345678 in form of a SMS 11 8 stw_RecvSMS NAME stw_RecvSMS Reads the next SMS via the TAF from the internal modem SYNOPSIS stw_RecvSMS WaitTimeSec single h v m DESCRIPTION This application can read SMS from the internal modem via dbus and ysmsd In order to use this application the ysmsd needs to...

Page 334: ... tcp listen PORT Open a listening TCP socket on port number PORT and wait for a incoming connection Format of the CAN messages is the STW TCP DLL format unix NAME Open a UNIX client socket and connect to the server specified by NAME NAME is the path and file name of the local UNIX socket e g var run service_stream1 Format of the CAN messages is the STW TCP DLL format Exit Status On error the exit ...

Page 335: ...Default value if option is omitted is KFX d LEVEL Specify the verbosity level to control the amount of status information printed to the console stderr Supported values for LEVEL range from 0 none default to 4 very verbose f FORMAT Specify the output format of variable values when printing to stdout Supported values for FORMAT are DEC Decimal and HEX Hexadecimal Default value if option is omitted ...

Page 336: ...the values of all variables variable list ListName from the ECU and write it to FILE The file extension specifies the file format RVI specifies the ASCII file format all other extensions e g DAT specify the binary data file format Both formats are compatible with the RamView tool Mandatory config options i p Optional config options c eeprom flush FILE Write all variable values specified in FILE to...

Page 337: ...ttings would allow this Format of FILE One line per variable list name variable name cycle time access right Values for cycle time 1 don t read variable 0 read variable once 0 read variable cyclically cycle time in milliseconds Values for access right RW Read Write RO Read only WO Write only NV Not visible Mandatory config options p Optional config options eeprom make_xml FILE Create a XML file co...

Page 338: ...sp dp_create Create a template config file var cfg containing all lists and variables of KEFEX project sample ksp Edit the file to select the variables that shall be read once or cyclically kefex_client p sample ksp dp_defcfg var cfg Read values of variables specified in file var cfg and write it to TAF data pool sample Reading stops on program termination kefex_client p sample ksp i can0 dp_fill ...

Page 339: ... php rb inc index file names index html Copy your html pages to the path specified under server document root Starting the server To test the syntax of the configuration file lighttpd t f mnt usrflash etc lighttpd conf To start the server lighttpd D f mnt usrflash etc lighttpd conf Useful links http redmine lighttpd net wiki 1 TutorialConfiguration http redmine lighttpd net wiki 1 TutorialConfigur...

Page 340: ...rwise stated Linus Torvalds GNU GENERAL PUBLIC LICENSE Version 2 June 1991 Copyright C 1989 1991 Free Software Foundation Inc 51 Franklin St Fifth Floor Boston MA 02110 1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document but changing it is not allowed Preamble The licenses for most software are designed to take away your freedom to share and change it By ...

Page 341: ...se applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License The Program below refers to any such program or work and a work based on the Program means either the Program or any derivative work under copyright law that is to say a work containing the Program or a portion of it either verba...

Page 342: ...ion of derivative or collective works based on the Program In addition mere aggregation of another work not based on the Program with the Program or with a work based on the Program on a volume of a storage or distribution medium does not bring the other work under the scope of this License 3 You may copy and distribute the Program or a work based on it under Section 2 in object code or executable...

Page 343: ... consequence of a court judgment or allegation of patent infringement or for any other reason not limited to patent issues conditions are imposed on you whether by court order agreement or otherwise that contradict the conditions of this License they do not excuse you from the conditions of this License If you cannot distribute so as to satisfy simultaneously your obligations under this License an...

Page 344: ... OTHER PARTIES PROVIDE THE PROGRAM AS IS WITHOUT WARRANTY OF ANY KIND EITHER EXPRESSED OR IMPLIED INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU SHOULD THE PROGRAM PROVE DEFECTIVE YOU ASSUME THE COST OF ALL NECESSARY SERVICING REPAIR OR CORRECTION 12 IN NO EVENT...

Page 345: ...right interest in the program Gnomovision which makes passes at compilers written by James Hacker signature of Ty Coon 1 April 1989 Ty Coon President of Vice This General Public License does not permit incorporating your program into proprietary programs If your program is a subroutine library you may consider it more useful to permit linking proprietary applications with the library If this is wh...

Page 346: ...ou these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the software or if you modify it For example if you distribute copies of such a program whether gratis or for a fee you must give the recipients all the rights that you have You must make sure that they too receive or can get the source code And you mus...

Page 347: ...stating that you changed the files and the date of any change b You must cause any work that you distribute or publish that in whole or in part contains or is derived from the Program or any part thereof to be licensed as a whole at no charge to all third parties under the terms of this License c If the modified program normally reads commands interactively when run you must cause it when started ...

Page 348: ...s unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated place then offering equivalent access to copy the source code from the same place counts as distribution of the source code even though third parties are not compelled to copy the source along with the object code 4 You may not copy modify subl...

Page 349: ... an explicit geographical distribution limitation excluding those countries so that distribution is permitted only in or among countries not thus excluded In such case this License incorporates the limitation as if written in the body of this License 9 The Free Software Foundation may publish revised and or new versions of the General Public License from time to time Such new versions will be simi...

Page 350: ...are and change it By contrast the GNU General Public License is intended to guarantee your freedom to share and change free software to make sure the software is free for all its users This General Public License applies to most of the Free Software Foundation s software and to any other program whose authors commit to using it Some other Free Software Foundation software is covered by the GNU Lib...

Page 351: ...icense they are outside its scope The act of running the Program is not restricted and the output from the Program is covered only if its contents constitute a work based on the Program independent of having been made by running the Program Whether that is true depends on what the Program does 1 You may copy and distribute verbatim copies of the Program s source code as you receive it in any mediu...

Page 352: ...or software interchange or b Accompany it with a written offer valid for at least three years to give any third party for a charge no more than your cost of physically performing source distribution a complete machine readable copy of the corresponding source code to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange or c Accompany it wit...

Page 353: ...both it and this License would be to refrain entirely from distribution of the Program If any portion of this section is held invalid or unenforceable under any particular circumstance the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances It is not the purpose of this section to induce you to infringe any patents or other property ri...

Page 354: ...DING ANY GENERAL SPECIAL INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES END OF TERMS A...

Page 355: ...s what you want to do use the GNU Library General Public License instead of this License 12 4 uClibc License uClibc is licensed under the LGPL v2 1 GNU LESSER GENERAL PUBLIC LICENSE Version 2 1 February 1999 Copyright C 1991 1999 Free Software Foundation Inc 51 Franklin St Fifth Floor Boston MA 02110 1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document but...

Page 356: ...ing a restrictive license from a patent holder Therefore we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license Most GNU software including some libraries is covered by the ordinary GNU General Public License This license the GNU Lesser General Public License applies to certain designated libraries and is qu...

Page 357: ...any derivative work under copyright law that is to say a work containing the Library or a portion of it either verbatim or with modifications and or translated straightforwardly into another language Hereinafter translation is included without limitation in the term modification Source code for a work means the preferred form of the work for making modifications to it For a library complete source...

Page 358: ... License whose permissions for other licensees extend to the entire whole and thus to each and every part regardless of who wrote it Thus it is not the intent of this section to claim rights or contest your rights to work written entirely by you rather the intent is to exercise the right to control the distribution of derivative or collective works based on the Library In addition mere aggregation...

Page 359: ...rwise if the work is a derivative of the Library you may distribute the object code for the work under the terms of Section 6 Any executables containing that work also fall under Section 6 whether or not they are linked directly with the Library itself 6 As an exception to the Sections above you may also combine or link a work that uses the Library with the Library to produce a work containing por...

Page 360: ...overed by this License and distribute such a combined library provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted and provided that you do these two things a Accompany the combined library with a copy of the same work based on the Library uncombined with any other library facilities This must be distributed under the t...

Page 361: ...ling to distribute software through any other system and a licensee cannot impose that choice This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License 12 If the distribution and or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces the original copyright holder who places the Library under t...

Page 362: ...mitting redistribution under these terms or alternatively under the terms of the ordinary General Public License To apply these terms attach the following notices to the library It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty and each file should have at least the copyright line and a pointer to where the full notice is found one li...

Page 363: ...204 1 Safety of machinery Electrical equipment of machines Part 1 General requirements Compliance with air and creeping distances Covered by software Integra STW Company Standard Supply voltage Operation at minimum and maximum supply voltage 9 32 V Duration 60 minutes STW Company Standard Overvoltage Undervoltage Operation at 32 96 V and 5 53 V maximum 3 above maximum supply voltage and below mini...

Page 364: ...voltage is disconnected NOR Flash 20 years NAND Flash 10 years STW Company Standard Load test Operate 48 hours at minimum temperature with minimum voltage and maximum current 40 C 9V 350 mA Afterwards operate 48 hours at maximum temperature with maximum voltage and maximum current 70 C 32V 350 mA ISO 16750 2 Direct current supply voltage Operation at minimum and maximum supply voltage ISO 16750 2 ...

Page 365: ... III Level IV 24 V Code E minimum supply voltage 10 V maximum supply voltage 32 V Level I Level II Level III ISO 16750 2 Discontinuities in supply voltage Load dump Test B 10 pulses ISO 16750 2 Reversed voltage Case 2 12 V system Test voltage 14 V 24 V system Test voltage 28 V Reversed polarity to all relevant inputs terminals for a duration of 60 6 seconds ISO 16750 2 Open circuit tests Single li...

Page 366: ...Hz bandwidth 2006 28 EG ISO 11452 5 2 Radiated immunity Stripline 10 kHz 400 MHz 200V m 80 AM Antenna ALSE 200 MHz 3 GHz 200 V m PM ISO 7637 2 Voltage transient emissions test ISO 7637 2 Electrical transient conduction along supply lines only Pulse 1 12 V Pulse 1 24 V 100 V 5000 pulses 10 600 V 5000 pulses 50 Pulse 2a 12 V 24 V Pulse 2b 12 V Pulse 2b 24 V 50 V 5000 pulses 2 10 V 10 pulses 20 V 10 ...

Page 367: ...discharge 4 kV air discharge 8 kV DIN EN 61000 6 2 Immunity for industrial environments Radiated radio frequency electromagnetic field immunity test DIN EN 61000 4 3 80 MHz to 1 0 GHz 10 V m 1 4 GHz to 2 0 GHz 3 V m 2 0 GHz to 2 7 GHz 1 V m 3 m horizontal and vertical DIN EN 61000 6 2 Immunity for industrial environments Immunity to conducted disturbances induced by radio frequency fields DIN EN 6...

Page 368: ...to 2 kHz 1 oct min 5 g 10 cycles bidirectional DIN EN 60068 2 27 Shock 50 g 11 ms sinus 3 shocks axis DIN EN 60068 2 27 Bump Acceleration 30 g time 6 ms sinus 1000 shocks axis ISO 16750 4 Tests at constant temperature low temperature storage 24 hours at 40 C ISO 16750 4 Tests at constant temperature low temperature operation 24 hours at 40 C ISO 16750 4 Tests at constant temperature high temperatu...

Page 369: ...e humidity cyclic test 10 cycles each 24 hours 5 of them with frost phase 10 C upper temperature 65 C 93 relative humidity ISO 16750 4 IEC 60068 2 78 Damp heat steady state test Severity 40 2 C and 85 3 humidity test duration 21 days 20 days and 23 hours without operation the last hour in typical operation mode ISO 16750 4 IEC 60068 2 60 Test Ke method 4 Corrosion test with flow of mixed gas Test ...

Page 370: ...282 Communication Interfaces 27 314 Compliance Information 363 Connect TC1 19 Connect to Development Box 18 19 Connecting Guidelines 33 363 Connector 18 29 30 33 35 Contact 14 Copyright 15 Create New Project 277 280 Create Own Application 277 295 305 Create Own Root File System 268 D Data daemon 91 Datalogger 189 Datapool 158 D Bus Utils 133 dbus_call_method 141 dbus_call_signal 143 dbus_close 136...

Page 371: ...nputs and Outputs 28 Insert SIM Card 18 Install the Code Blocks IDE 286 Blocks IDE 297 Install the Toolchain 283 284 296 Introduction 13 124 133 136 138 151 158 189 198 204 207 215 220 222 229 232 236 241 248 IP handling 61 K kefex_client STW KEFEX console client 335 L Libraries 306 Lighttpd Webserver 338 Linux 284 Linux Folder Structure 72 Linux Kernel License 340 Linux Updater 270 310 Logger dae...

Page 372: ...Signal daemon 109 248 250 SMS 50 232 SMS daemon 50 98 232 Software 37 Static mode 215 Static Mode 172 STW Build Scripts 268 271 275 STW Folder Structure 75 stw_acc2can 329 stw_dptool 326 stw_flash_client 332 stw_GetGPS 327 stw_ReadACC 328 stw_RecvSMS 333 stw_SendSMS 333 stw_show_gps 331 System 151 System daemon 42 82 88 System Data 29 System Information 37 T TAF Components 88 TAF Library 124 Targe...

Page 373: ..._socket_exists 255 utils_strlcpy 256 utils_write_string_value 264 V Variants 23 W Warranty 15 Watchdog 82 Windows 296 Windows Updater 308 WLAN 54 Y ydatad_add_variable_to_list 160 ydatad_check_update_list 186 ydatad_check_update_variable 187 ydatad_create_variable_list 159 ydatad_delete_datapool 168 ydatad_delete_variable_list 164 ydatad_get_datapool_base_path 166 ydatad_get_datapool_info 178 ydat...

Page 374: ... 228 ynetworkd_get_connected_interface 46 236 ynetworkd_start_connection 46 237 ynetworkd_stop_connection 46 239 yserverd_request_nextjob 247 ysignald_GPS_con_state 112 250 ysignald_internet_con_state 112 248 ysmsd_request_sms_fetch_urgent 51 234 ysmsd_send_sms 50 232 ysmsd_send_sms_urgent 50 233 ysysd_cancel_watch_dog 82 153 ysysd_get_ignition_status 42 154 ysysd_register_watch_dog 82 151 ysysd_r...

Reviews: