diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2019-12-15 10:55:19 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2019-12-15 10:55:19 +0200 |
| commit | b9841dece2cc5b8c09d7a67cea07e3cf7725278e (patch) | |
| tree | ed21d6445a73864c92a94695ca2367c7fc863bd2 /Software/Embedded_SW/Embedded/Communication | |
| parent | c1097749b08fb69e8ce5ceb1f2eea2992ac73e5e (diff) | |
| download | Tango-b9841dece2cc5b8c09d7a67cea07e3cf7725278e.tar.gz Tango-b9841dece2cc5b8c09d7a67cea07e3cf7725278e.zip | |
IsAfterReset supported (returns true only on first connection request)
Diffstat (limited to 'Software/Embedded_SW/Embedded/Communication')
3 files changed, 25 insertions, 6 deletions
diff --git a/Software/Embedded_SW/Embedded/Communication/Connection.c b/Software/Embedded_SW/Embedded/Communication/Connection.c index d92741e01..18f176e64 100644 --- a/Software/Embedded_SW/Embedded/Communication/Connection.c +++ b/Software/Embedded_SW/Embedded/Communication/Connection.c @@ -30,6 +30,7 @@ #include "Modules/AlarmHandling/AlarmHandling.h" #include "Modules/Stubs_Handler/Stub_HW_Version.h" +bool FirstConnection = true; char HexToDecimal(char hex) { int i = hex % 0x10; @@ -44,10 +45,10 @@ void ConnectionRequest(MessageContainer* requestContainer) DeviceInformation DevInfo = DEVICE_INFORMATION__INIT; ConnectResponse response = CONNECT_RESPONSE__INIT; - if (GeneralHwReady == false) + /*if (GeneralHwReady == false) { return; - } + }*/ unsigned char Major = 0; unsigned char Year = 0 ; unsigned char Month = 0; @@ -90,6 +91,9 @@ void ConnectionRequest(MessageContainer* requestContainer) DevInfo.boardrevision = BoardVersion; DevInfo.assemblyversion = AssyVersion; + response.has_isafterreset = true; + response.isafterreset = FirstConnection; + FirstConnection = false; responseContainer = createContainer(MESSAGE_TYPE__ConnectResponse, requestContainer->token, true, &response, &connect_response__pack, &connect_response__get_packed_size); diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Connection/ConnectResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Connection/ConnectResponse.pb-c.c index ce449266e..ddc2f318a 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Connection/ConnectResponse.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Connection/ConnectResponse.pb-c.c @@ -52,7 +52,7 @@ void connect_response__free_unpacked assert(message->base.descriptor == &connect_response__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -static const ProtobufCFieldDescriptor connect_response__field_descriptors[1] = +static const ProtobufCFieldDescriptor connect_response__field_descriptors[2] = { { "DeviceInformation", @@ -66,14 +66,27 @@ static const ProtobufCFieldDescriptor connect_response__field_descriptors[1] = 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, + { + "IsAfterReset", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(ConnectResponse, has_isafterreset), + offsetof(ConnectResponse, isafterreset), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, }; static const unsigned connect_response__field_indices_by_name[] = { 0, /* field[0] = DeviceInformation */ + 1, /* field[1] = IsAfterReset */ }; static const ProtobufCIntRange connect_response__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 1 } + { 0, 2 } }; const ProtobufCMessageDescriptor connect_response__descriptor = { @@ -83,7 +96,7 @@ const ProtobufCMessageDescriptor connect_response__descriptor = "ConnectResponse", "", sizeof(ConnectResponse), - 1, + 2, connect_response__field_descriptors, connect_response__field_indices_by_name, 1, connect_response__number_ranges, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Connection/ConnectResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Connection/ConnectResponse.pb-c.h index 85a15995c..2bd756a07 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Connection/ConnectResponse.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Connection/ConnectResponse.pb-c.h @@ -28,10 +28,12 @@ struct _ConnectResponse { ProtobufCMessage base; DeviceInformation *deviceinformation; + protobuf_c_boolean has_isafterreset; + protobuf_c_boolean isafterreset; }; #define CONNECT_RESPONSE__INIT \ { PROTOBUF_C_MESSAGE_INIT (&connect_response__descriptor) \ - , NULL } + , NULL, 0, 0 } /* ConnectResponse methods */ |
