read temperature test
This commit is contained in:
README.md
gomspace
gomspace.mkclock.ccommands.cconn.ccsp.cwscript
libgscsp
include
gs
lib
libcsp
CHANGELOGCONTRIBUTORSCOPYINGINSTALL.rstREADME.rst
bindings
python
libcsp
doc
example.rsthistory.rstinterfaces.rstlibcsp.rstmemory.rstmtu.rstprotocolstack.rststructure.rsttopology.rst
examples
csp_if_fifo.ccsp_if_fifo_windows.ckiss.cpython_bindings_example_client.pypython_bindings_example_client_can.pypython_bindings_example_server.pysimple.czmqproxy.c
include
csp
src
arch
freertos
macosx
posix
windows
bindings
python
crypto
csp_bridge.ccsp_buffer.ccsp_conn.ccsp_conn.hcsp_crc32.ccsp_debug.ccsp_dedup.ccsp_dedup.hcsp_endian.ccsp_hex_dump.ccsp_iflist.ccsp_io.ccsp_io.hcsp_port.ccsp_port.hcsp_promisc.ccsp_promisc.hcsp_qfifo.ccsp_qfifo.hcsp_route.ccsp_route.hcsp_service_handler.ccsp_services.ccsp_sfp.cdrivers
interfaces
rtable
transport
utils
wafwscriptsrc
bindings
python
drivers
error.cfreertos
linux
local.hlog.crouter.crtable.cservice_dispatcher.cservice_handler.ctransaction.clibparam_client
include
gs
param
internal
libutil
include
gs
util
log
test/testtasks
@ -6,9 +6,9 @@
|
||||
*/
|
||||
|
||||
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
||||
#include "P60DockTestTask.h"
|
||||
|
||||
#include <csp/drivers/can_socketcan.h>
|
||||
#include "P60DockTestTask.h"
|
||||
|
||||
P60DockTestTask::P60DockTestTask(object_id_t objectId_):
|
||||
SystemObject(objectId_){
|
||||
@ -23,6 +23,10 @@ ReturnValue_t P60DockTestTask::performOperation(uint8_t operationCode) {
|
||||
if(sendPacket() != HasReturnvaluesIF::RETURN_OK){
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
|
||||
if(getParameters() != HasReturnvaluesIF::RETURN_OK){
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
@ -74,17 +78,23 @@ ReturnValue_t P60DockTestTask::sendPacket(void){
|
||||
|
||||
|
||||
ReturnValue_t P60DockTestTask::getParameters(void) {
|
||||
gs_param_table_instance_t node_hk;
|
||||
// int result = rparam_get_full_table(&node_hk, p60dock_node, P60_PORT_RPARAM,
|
||||
uint32_t timeout;
|
||||
int result = p60dock_get_hk(&node_hk, p60dock_node, timeout);
|
||||
uint32_t timeout = 1000;
|
||||
node_hk.rows = (gs_param_table_row_t*)p60dock_hk;
|
||||
node_hk.id = P60DOCK_HK;
|
||||
node_hk.row_count = p60dock_hk_count;
|
||||
node_hk.memory_size = P60DOCK_HK_SIZE;
|
||||
node_hk.memory = hk_mem;
|
||||
int result = gs_rparam_get_full_table(&node_hk, p60dockAddress, node_hk.id,
|
||||
GS_RPARAM_MAGIC_CHECKSUM, timeout);
|
||||
|
||||
if (result != 0) {
|
||||
sif::info << "Error retrieving P60 Dock housekeeping\n" << std::endl;
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
} else {
|
||||
uint8_t tableOffsetTemperature = 0x44;
|
||||
uint8_t temperature[2];
|
||||
size_t parameterSize = 2;
|
||||
int16_t temperature[2];
|
||||
size_t parameterSize = sizeof(temperature);
|
||||
uint32_t flags = 0;
|
||||
result = gs_param_get_data((gs_param_table_instance_t*) &node_hk,
|
||||
tableOffsetTemperature, temperature, parameterSize, flags);
|
||||
|
Reference in New Issue
Block a user