Unison Help

- Unison Kernel
- Pthreads
- pthread_create()
- pthread_exit()
- pthread_self()
- pthread_equal()
- pthread_join()
- pthread_detach()
- pthread_setschedparam()
- pthread_getschedparam()
- pthread_attr_init()
- pthread_attr_destroy()
- pthread_attr_setstackaddr()
- pthread_attr_getstackaddr()
- pthread_attr_setstacksize()
- pthread_attr_getstacksize()
- pthread_attr_setschedparam()
- pthread_attr_getschedparam()
- pthread_attr_setdetachstate()
- pthread_attr_getdetachstate()
- pthread_stackinfo()
- pthread_setprio()
- pthread_getprio()
- sched_get_priority_max()
- sched_get_priority_min()
- sched_yield()
- Pthread Cancellation
- Mutex
- Semaphores
- Message Queues
- Conditional Variables
- Barriers
- Timers
- Clocks
- Memory Allocation
- Rendezvous
- Interrupts
- Directory Services
- Miscellaneous
- Pthreads
- Unison I/O Library
- Unison STDIO Library
- STDIO Library Calls
- clearerr()
- dprintf()
- fclose()
- fdopen()
- feof()
- ferror()
- fileno()
- fflush()
- fgetc()
- fgetpos()
- fgets()
- fopen()
- fprintf()
- fputc()
- fputs()
- fread()
- freopen()
- fscanf()
- fseek()
- fseeko()
- fsetpos()
- ftell()
- ftello()
- fwrite()
- getc()
- getc_unlocked()
- getchar()
- getchar_unlocked()
- getdelim()
- getline()
- gets()
- get_stderr_ptr()
- get_stdin_ptr()
- get_stdout_ptr()
- noperprintf()
- perprintf()
- perror()
- posix_compat()
- printf()
- putc()
- putc_unlocked()
- putchar()
- putchar_unlocked()
- puts()
- remove()
- rewind()
- scanf()
- setbuf()
- setvbuf()
- snprintf()
- sprintf()
- sscanf()
- stderr_init()
- stderr_close()
- stdin_init()
- stdin_close()
- stdout_init()
- stdout_close()
- vdprintf()
- vscanf()
- vsscanf()
- vfscanf()
- vprintf()
- vsnprintf()
- vsprintf()
- vfprintf()
- ungetc()
- Do-nothing Stubs
- STDIO Library Calls
- Unison LIBC Library
- Unison I/O Servers
- Graphics, Camera, Video, Audio
- Network Protocols
- TCP and UDP Server - tcpd
- DHCP Client Service - dhcp client
- DHCP Server - dhcpd
- Telnet Server - telnetd
- Tiny FTP Server - tftpd
- Point to Point - pppd
- Network Translation - NAT with PAT
- Firewall
- Tiny HTTP Server - thttpd
- Tiny HTTP Server with TLS
- POP3 Server
- Simple Mail Transfer Protocol Services (SMTP)
- Bootp Protocol
- File Transfer Protocol Server (FTP)
- File Transfer Client Services
- RPC / XDR
- DNS Client
- HTTP/HTTPS Client
- REST Client
- AutoIP Service - autoip client
- mDNS server - mdnsd
- SNTP Client
- SNMP Agent - Snmpd server
- SSL/TLS library
- SSH server
- IP security
- Power Control
- Serial I/O
- System Services
- Universal Serial Bus (USB)
- Wireless
- Remedy Tools for Unison
7.32.6.Remedy Remote Control Tools #
OVERVIEW
The Remedy Remote Control Tools consists from two components:
– Remote Control Tool: host side component.
– Remote Control Server: target side component.
The Remote Control Tool is host IDE specific tool, therefore it is described in a separate file: see directory installdir/manuals.
The Remote Control Server is an IDE independent target component. Its operation is described below.
NAME
Remote Control Server – RCS
SYNOPSIS
#include <rcs.h>
- pthread_create(&rcsTid, &rcsattr, (void *)rcs, (void *)&rcs_init);
THREAD rcs(struct rcs_settings *rcs_init);
DESCRIPTION
The RCS provides remote control of target variables. RCS works together with the IDE RemoteControl plugin. This plugin sends commands to RCS and gets responses using the network UDP protocol.
The RemoteControl plugin may read and write target variables only if it knows and uses their addresses. User can make a target source code structure with a variables description to provide information for the target variables to be controlled. This information will be passed to the RemoteControl plugin and the plugin will have all necessery information about the variables being controlled.
The RCS structure for variables to be controlled is described in the file <rcs.h>:
// RCS variable description struct RCS_variable { uchar VarName[16]; uchar VarType; uchar VarAccessBits; uint_32 VarAddress; };
The RemoteControl plugin will display the symbolic variable name specified by VarName.
For each variable, the user sets the variable bit width (or size in bits) and it’s address size in bits. This information writes in the field VarType:
– type_int32_32: 32-bits variable / 32-bits address;
– type_int16_32: 16-bits variable / 32-bits address;
– type_int8_32: 8-bits variable / 32-bits address;
– type_bool_32: bool variable / 32-bits address;
– type_int32_16: 32-bits variable / 16-bits address;
– type_int16_16: 16-bits variable / 16-bits address;
– type_int8_16: 8-bits variable / 16-bits address;
– type_bool_16: bool variable / 16-bits address.
Each variable has access permissions. This access information is written to the field VarAccessBits:
– acc_read: read only;
– acc_write: write only;
– acc_rdwr: read/write.
RCS initialization
The RCS initiatization structure can be found in the file <rcs.h>:
// // RCS initialization structure // struct rcs_settings { struct RCS_variable *RCS_vars; // RCS control variables u_char RCS_vars_numb; // RCS control variables numbers void *dlog_control_funcs; // pointer to dlog control functions structure u_short server_port; // RCS port };
For the RemoteControl plugin, the user can create a structure with a variable description for each controlled variable. The address of first element this structure is written in *RCS_vars. In the field RCS_vars_numb write the number of structure elements.
RCS has integration with dlog server. The Dlog server sends the events log to IDE Event Viewer. With help of RCS the user can do remote dlog management. To activate this control we need to write in the *dlog_control_funcs value with the address of structure of dlog control functions.
RCS receives commands from the IDE RemoteControl plugin on port server_port.
EXAMPLE
This partial example shows the creation and registration of the RCS.
#include <dlog.h> #include <rcs.h> // RCS control variables int_32 var32_rw = 32; int_16 var16_rw = 16; int_8 var8_rw = 8; const int_32 var32_ro = 0x12345678; const int_16 var16_ro = 0x7890; const int_8 var8_ro = 0x55; struct RCS_variable RCS_var_array[] = { {"var32_rw", type_int32_32, acc_rdwr, (uint_32)&var32_rw}, {"var16_rw", type_int16_32, acc_rdwr, (uint_32)&var16_rw}, {"var8_rw", type_int8_32, acc_rdwr, (uint_32)&var8_rw}, {"var32_ro", type_int32_32, acc_read, (uint_32)&var32_ro}, {"var16_ro", type_int16_32, acc_read, (uint_32)&var16_ro}, {"var8_ro", type_int8_32, acc_read, (uint_32)&var8_ro} }; /* * rcs variables and start routine */ struct rcs_settings rcs_init; void rcs_start(void) { pthread_t rcsTid; pthread_attr_t rcsattr; struct sched_param rcsPriority; // Fill parameters rcs_init.RCS_vars = &RCS_var_array[0]; rcs_init.RCS_vars_numb = sizeof(RCS_var_array)/sizeof(struct RCS_variable); rcs_init.dlog_control_funcs = (void *)&dlog_ctrl_funcs; rcs_init.server_port = 16000; pthread_attr_init(&rcsattr); pthread_attr_setstacksize(&rcsattr, 1400); rcsPriority.sched_priority = 7; pthread_attr_setschedparam(&rcsattr, &rcsPriority); pthread_create(&rcsTid, &rcsattr, (void *)rcs, (void *)&rcs_init); pthread_attr_destroy(&rcsattr); }
NOTES
There is a demo available for the Unison and DSPnano RCS which is found in installdir/demos.