/// <summary> /// Get all the possible values for a specific param /// </summary> public async Task <CamGetParamValuesMessage> GetParamValues(string param) { // Create the message UserGetParamValuesMessage GetValuesMsg = new UserGetParamValuesMessage(_token, param); // Get the codec UserGetParamValuesMessageCodec UserValuesCodec = new UserGetParamValuesMessageCodec(); // Send the message if (await Send(await UserValuesCodec.Encode(GetValuesMsg))) { // If sent, get the response string MsgReceived = await _CameraSocket.Receive(); // Get the codec CamGetParamValuesMessageCodec CamValuesCodec = new CamGetParamValuesMessageCodec(); // Decode the string CamGetParamValuesMessage CamValuesMsg = await CamValuesCodec.Decode(MsgReceived); if (CamValuesMsg.rval != 0 || CamValuesMsg.msg_id != GetValuesMsg.msg_id) { return(null); } return(CamValuesMsg); } // If there is a problem return(null); }
public void CreateUserGetParamValuesMessage() { UserGetParamValuesMessage GetParam = new UserGetParamValuesMessage(token, Param); Assert.AreEqual(GetParam.token, token); Assert.AreEqual(GetParam.param, Param); Assert.AreEqual(GetParam.msg_id, 9); //MUST be 9 }