all parameter requests implemented
This commit is contained in:
@ -504,6 +504,12 @@ ReturnValue_t Lisa::createCommand(uint8_t* buffer) {
|
||||
}
|
||||
addfloat(param, buffer + offset);
|
||||
offset += sizeof(float);
|
||||
result = getParam(arcseckeys::RATING_WEIGHT_MEAN_SUM, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
addfloat(param, buffer + offset);
|
||||
offset += sizeof(float);
|
||||
result = getParam(arcseckeys::RATING_WEIGHT_DB_STAR_COUNT, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
@ -632,3 +638,280 @@ ReturnValue_t Algo::createCommand(uint8_t* buffer) {
|
||||
adduint8(param, buffer + offset);
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
LogLevel::LogLevel() : ArcsecJsonParamBase(arcseckeys::LOGLEVEL) {}
|
||||
|
||||
size_t LogLevel::getSize() { return COMMAND_SIZE; }
|
||||
|
||||
ReturnValue_t LogLevel::createCommand(uint8_t* buffer) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
uint8_t offset = 0;
|
||||
std::string param;
|
||||
addSetParamHeader(buffer, StarTracker::ID::LOG_LEVEL);
|
||||
offset = 2;
|
||||
result = getParam(arcseckeys::LOGLEVEL1, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL2, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL3, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL4, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL5, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL6, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL7, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL8, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL9, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL10, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL11, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL12, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL13, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL14, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL15, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL16, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
Subscription::Subscription() : ArcsecJsonParamBase(arcseckeys::SUBSCRIPTION) {}
|
||||
|
||||
size_t Subscription::getSize() { return COMMAND_SIZE; }
|
||||
|
||||
ReturnValue_t Subscription::createCommand(uint8_t* buffer) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
uint8_t offset = 0;
|
||||
std::string param;
|
||||
addSetParamHeader(buffer, StarTracker::ID::SUBSCRIPTION);
|
||||
offset = 2;
|
||||
result = getParam(arcseckeys::TELEMETRY_1, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_2, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_3, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_4, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_5, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_6, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_7, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_8, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_9, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_10, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_11, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_12, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_13, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_14, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_15, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_16, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
LogSubscription::LogSubscription() : ArcsecJsonParamBase(arcseckeys::LOG_SUBSCRIPTION) {}
|
||||
|
||||
size_t LogSubscription::getSize() { return COMMAND_SIZE; }
|
||||
|
||||
ReturnValue_t LogSubscription::createCommand(uint8_t* buffer) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
uint8_t offset = 0;
|
||||
std::string param;
|
||||
addSetParamHeader(buffer, StarTracker::ID::LOG_SUBSCRIPTION);
|
||||
offset = 2;
|
||||
result = getParam(arcseckeys::LEVEL1, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::MODULE1, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LEVEL2, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::MODULE2, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
DebugCamera::DebugCamera() : ArcsecJsonParamBase(arcseckeys::DEBUG_CAMERA) {}
|
||||
|
||||
size_t DebugCamera::getSize() { return COMMAND_SIZE; }
|
||||
|
||||
ReturnValue_t DebugCamera::createCommand(uint8_t* buffer) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
uint8_t offset = 0;
|
||||
std::string param;
|
||||
addSetParamHeader(buffer, StarTracker::ID::DEBUG_CAMERA);
|
||||
offset = 2;
|
||||
result = getParam(arcseckeys::TIMING, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint32(param, buffer + offset);
|
||||
offset += sizeof(uint32_t);
|
||||
result = getParam(arcseckeys::TEST, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint32(param, buffer + offset);
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
Reference in New Issue
Block a user