NanoPower P60 Dock
July 14, 2017
gs-man-nanopower-p60-dock-2.1
6. Client API
The client API consists of a set of wrapper functions that simplify the CSP interface to the P60 Dock. These
functions are implemented in the p60dock_client.c file and can be integrated in custom code by including
the p60dock.h header file. The file p60dock_cmd.c implements the GOSH commands for the P60 Dock and
can be used as an additional reference for the use of the client API.
All the client functions specify a timeout argument that is used to specify the maximum number of milliseconds
to wait for a reply. The client interface automatically performs endian conversion to network byte order on all
arguments.
6.1 CSP Port numbers
The P60 Dock listens on the following CSP port numbers
Table 6.1: P60 Dock CSP port numbers
Port Name Description
0 CSP_CMP Control Port
1 CSP_PING Returns a copy of the packet received
2 CSP_PS Returns process list
3 CSP_MEMFREE Returns memory free
4 CSP_REBOOT Reboots subsystem
5 CSP_BUF_FREE Returns number of free buffers
6 CSP_UPTIME Returns subsystem uptime
7 P60_PORT_RPARAM Controls P60 Dock with parameter system (see Get and Set Con-
figuration Parameters)
9 P60_PORT_GNDWDT_RESET Used for ground watchdog reset (see Reset Ground Watchdog
Timer)
10 P60_PORT_CMDCONTROL Reserved for future use
For a description on how to use the CSP ports, please see libcsp manual. For a description on the parameter
system, please see libparam manual.
6.2 Get and Set Configuration Parameters
Getting and setting configuration parameters is done by using the remote parameter system API provided by
libparam.
Get a single configuration parameter from P60 Dock:
#include <p60dock.h>
/
*
Get enable status for X1 VCC
*
/
uint8_t vcc_enable;
int res = rparam_get_single(&vcc_enable, /
*
Pointer to variable
*
/
P60DOCK_OUT_EN(0), /
*
Logical address of parameter
*
/
PARAM_UINT8, /
*
Parameter type
*
/
1, /
*
Parameter size
*
/
P60DOCK_PARAM, /
*
Parameter table id
*
/
p60dock_node, /
*
P60 Dock csp node address
*
/
P60_PORT_RPARAM, /
*
CSP port number
*
/
1000); /
*
Timeout in milliseconds
*
/
© 2016 GomSpace Aps
13