bugfix about AirDistribution 73/137473/2 accepted/tizen_4.0_unified accepted/tizen_unified tizen tizen_4.0 accepted/tizen/4.0/unified/20170816.014149 accepted/tizen/4.0/unified/20170828.222005 accepted/tizen/unified/20170706.194039 submit/tizen/20170706.060922 submit/tizen_4.0/20170811.094300 submit/tizen_4.0/20170814.115522 submit/tizen_4.0/20170828.100008 submit/tizen_4.0_unified/20170814.115522
authorSangjung Woo <sangjung.woo@samsung.com>
Thu, 6 Jul 2017 05:38:19 +0000 (14:38 +0900)
committerSangjung Woo <sangjung.woo@samsung.com>
Thu, 6 Jul 2017 05:55:20 +0000 (14:55 +0900)
Because of the wrong type of AirDistribution, related APIs fails to
get/set the value. This patch fixes the bug.

Change-Id: I5c38335560d64dc1abc43738cd661f8cfd7b1d88
Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
lib/client/libamb-objects.h
lib/client/test/test.c

index c4e8bbf..b6d2a4e 100644 (file)
@@ -202,7 +202,7 @@ CAN_OBJECT(CidWatchDD,          guchar, NULL);
  * CANID: 1026 (0x402)
  */
 CAN_OBJECT(CidACOnOff,                 gboolean, NULL);
-CAN_OBJECT(AirDistributionCID,  guchar, NULL);
+CAN_OBJECT(AirDistributionCID,  guint16, NULL);
 CAN_OBJECT(LeftTemperatureCID,  gdouble, NULL);
 CAN_OBJECT(LeftAirflowCID,      guint16, NULL);
 CAN_OBJECT(RightTemperatureCID, gdouble, NULL);
@@ -244,7 +244,7 @@ CAN_OBJECT(TRIP_B_EllapsedTime, guint16, NULL);
  * Left Knob Control
  * CANID: 1793 (0x701)
  */
-CAN_OBJECT(AirDistributionLeftKnob,     guchar, NULL);
+CAN_OBJECT(AirDistributionLeftKnob,     guint16, NULL);
 CAN_OBJECT(LeftTemperatureLeftKnob,     gdouble, NULL);
 CAN_OBJECT(LeftAirflowLeftKnob,         guint16, NULL);
 CAN_OBJECT(MediaVolumeLeftKnob,         guint16, NULL);
@@ -253,7 +253,7 @@ CAN_OBJECT(MediaVolumeLeftKnob,         guint16, NULL);
  * Right Knob Control
  * CANID: 1794 (0x702)
  */
-CAN_OBJECT(AirDistributionRightKnob,    guchar, NULL);
+CAN_OBJECT(AirDistributionRightKnob,    guint16, NULL);
 CAN_OBJECT(RightTemperatureRightKnob,   gdouble, NULL);
 CAN_OBJECT(RightAirflowLeftKnob,        guint16, NULL);
 CAN_OBJECT(MediaVolumeRightKnob,        guint16, NULL);
@@ -266,7 +266,7 @@ CAN_OBJECT_WRITABLE(CidCheckSeatHeaterL,        guint16, NULL);
 CAN_OBJECT_WRITABLE(CidCheckSeatHeaterR,           guint16, NULL);
 CAN_OBJECT_WRITABLE(CidCheckSeatCoolerL,           guint16, NULL);
 CAN_OBJECT_WRITABLE(CidCheckSeatCoolerR,           guint16, NULL);
-CAN_OBJECT_WRITABLE(AirDistributionCID,            guint16, NULL);
+CAN_OBJECT_WRITABLE(AirDistributionCID,                guint16, NULL);
 CAN_OBJECT_WRITABLE(LeftTemperatureCID,            gdouble, NULL);
 CAN_OBJECT_WRITABLE(LeftAirflowCID,            guint16, NULL);
 CAN_OBJECT_WRITABLE(RightTemperatureCID,    gdouble, NULL);
@@ -292,7 +292,7 @@ CAN_OBJECT_WRITABLE(MediaVolumeCID,     guint16, NULL);
  * Writable AMB Object
  * Left Knob Control
  */
-CAN_OBJECT_WRITABLE(AirDistributionLeftKnob,    guchar, NULL);
+CAN_OBJECT_WRITABLE(AirDistributionLeftKnob,    guint16, NULL);
 CAN_OBJECT_WRITABLE(LeftTemperatureLeftKnob,    gdouble, NULL);
 CAN_OBJECT_WRITABLE(LeftAirflowLeftKnob,        guint16, NULL);
 CAN_OBJECT_WRITABLE(MediaVolumeLeftKnob,        guint16, NULL);
@@ -301,7 +301,7 @@ CAN_OBJECT_WRITABLE(MediaVolumeLeftKnob,        guint16, NULL);
  * Writable AMB Object
  * Right Knob Control
  */
-CAN_OBJECT_WRITABLE(AirDistributionRightKnob,   guchar, NULL);
+CAN_OBJECT_WRITABLE(AirDistributionRightKnob,   guint16, NULL);
 CAN_OBJECT_WRITABLE(RightTemperatureRightKnob,  gdouble, NULL);
 CAN_OBJECT_WRITABLE(RightAirflowLeftKnob,       guint16, NULL);
 CAN_OBJECT_WRITABLE(MediaVolumeRightKnob,       guint16, NULL);
index 3f5219a..735f230 100644 (file)
@@ -449,8 +449,39 @@ static void test_set_CheckSeatHeaterL(int value)
        test_CheckSeatHeaterL();
 }
 
+void test_AirDistribution()
+{
+       struct AirDistributionCIDType *p;
+    int ret = amb_get_AirDistributionCID_with_zone(&p, 0);
+       if (ret != 0) {
+               fprintf(stderr, "Fail to %s\n", __func__);
+               return ;
+       }
+       fprintf(stderr, "Zone: %d\n", p->Zone);
+       fprintf(stderr, "Value: %d\n", p->Value);
+       fprintf(stderr, "ValueSequence: %d\n", p->ValueSequence);
+       fprintf(stderr, "Time: %f\n", p->Time);
+
+       amb_release_data(p);
+       return ;
+}
+
+static void test_set_AirDistribution(int value)
+{
+       int rc;
+
+       rc = amb_set_AirDistributionCID_with_zone(value, 0);
+       if (rc < 0) {
+               fprintf(stderr, "Fail to amb_set_CheckSeatHeaterL_with_zone(): %d\n", rc);
+               return ;
+       }
+
+       test_AirDistribution();
+}
+
 int main()
 {
+       test_set_AirDistribution(2);
        test_set_CheckSeatHeaterL(1);
        test_set_CheckSeatHeaterL(2);