Browse Source

ajout d'une option pour désarmer une alarme

FARINA Louis 2 years ago
parent
commit
68c9fa4ea5

BIN
RSTP_DSLink/.vs/RSTP_DSLink/v16/.suo View File


+ 1
- 1
RSTP_DSLink/RSTP_DSLink/Properties/launchSettings.json View File

2
   "profiles": {
2
   "profiles": {
3
     "RSTP_DSLink": {
3
     "RSTP_DSLink": {
4
       "commandName": "Project",
4
       "commandName": "Project",
5
-      "commandLineArgs": "--name RTSP --broker http://192.168.1.54:8080/conn"
5
+      "commandLineArgs": "--name RTSP --broker http://192.168.1.109:8080/conn"
6
     }
6
     }
7
   }
7
   }
8
 }
8
 }

+ 14
- 2
RSTP_DSLink/RSTP_DSLink/RSTP_DSLink.cs View File

173
                 node.Value.Set(false);
173
                 node.Value.Set(false);
174
             });
174
             });
175
 
175
 
176
+            Responder.AddNodeClass("onoffNode", delegate (Node node)
177
+            {
178
+                node.Configs.Set(ConfigType.Writable, new Value(Permission.Read.Permit));
179
+                node.Configs.Set(ConfigType.ValueType, DSLink.Nodes.ValueType.Boolean.TypeValue);
180
+                node.Value.Set(true);
181
+            });
182
+
176
             /*Responder.AddNodeClass("rng", delegate(Node node)
183
             /*Responder.AddNodeClass("rng", delegate(Node node)
177
             {
184
             {
178
                 node.Configs.Set(ConfigType.Writable, new Value(Permission.Read.Permit));
185
                 node.Configs.Set(ConfigType.Writable, new Value(Permission.Read.Permit));
281
                 var alarm = alarmRootNode.CreateChild(alarmName, "alarm").BuildNode();
288
                 var alarm = alarmRootNode.CreateChild(alarmName, "alarm").BuildNode();
282
 
289
 
283
                 alarm.CreateChild("remove", "removeNode").BuildNode();
290
                 alarm.CreateChild("remove", "removeNode").BuildNode();
291
+                alarm.CreateChild("armed", "onoffNode").BuildNode();
284
                 var ts = new CancellationTokenSource();
292
                 var ts = new CancellationTokenSource();
285
                 CancellationToken ct = ts.Token;
293
                 CancellationToken ct = ts.Token;
286
                 //on lance une tâche en parallèle, qui observe la pin et met à jour la valeur du noeud
294
                 //on lance une tâche en parallèle, qui observe la pin et met à jour la valeur du noeud
370
                             controller.WaitForEvent(pin, PinEventTypes.Falling, ct);
378
                             controller.WaitForEvent(pin, PinEventTypes.Falling, ct);
371
                             if (!ct.IsCancellationRequested)
379
                             if (!ct.IsCancellationRequested)
372
                             {
380
                             {
373
-                               // Console.WriteLine("Beep boop");
374
-                                alarm.Value.Set(true);
381
+                                // Console.WriteLine("Beep boop");
382
+                                alarm.Children.TryGetValue("armed", out Node ArmedNode);
383
+                                if(ArmedNode.Value.Boolean == true)
384
+                                {
385
+                                    alarm.Value.Set(true);
386
+                                }          
375
                             }
387
                             }
376
                         }
388
                         }
377
                         //Console.WriteLine("Task cancelled");
389
                         //Console.WriteLine("Task cancelled");

BIN
RSTP_DSLink/RSTP_DSLink/bin/Release/netcoreapp3.1/RSTP_DSLink.dll View File


BIN
RSTP_DSLink/RSTP_DSLink/bin/Release/netcoreapp3.1/RSTP_DSLink.pdb View File


+ 0
- 11
RSTP_DSLink/RSTP_DSLink/bin/Release/netcoreapp3.1/log-20210810.txt View File

1
-2021-08-10 16:29:29.035 +02:00 [Warning] Failed to load nodes.json
2
-2021-08-10 16:29:29.099 +02:00 [Warning] File does not exist: C:\Users\l.farina\Desktop\UCRM_stage\RSTP_DSLink\RSTP_DSLink\bin\Release\netcoreapp3.1\nodes.json
3
-2021-08-10 16:29:29.419 +02:00 [Warning]    at StandardStorage.Folder.GetFileAsync(String name, CancellationToken cancellationToken)
4
-   at DSLink.VFS.SystemVFS._getFile(String fileName)
5
-   at DSLink.VFS.SystemVFS.ReadAsync(String fileName)
6
-   at DSLink.Respond.DiskSerializer.DeserializeFromDisk()
7
-2021-08-10 16:29:29.559 +02:00 [Information] Handshaking with http://192.168.1.54:8080/conn?dsId=RTSP-kmS3ZynUOMIfzu1iULqqkTVS9SjCbL8iVeCkne0XCe0
8
-2021-08-10 16:29:29.851 +02:00 [Information] Handshake successful
9
-2021-08-10 16:29:30.102 +02:00 [Information] Connecting
10
-2021-08-10 16:29:30.112 +02:00 [Information] WebSocket connecting to ws://192.168.1.54:8080/ws?dsId=RTSP-kmS3ZynUOMIfzu1iULqqkTVS9SjCbL8iVeCkne0XCe0&auth=vKUt6sCqqK4mOVAHm1qLyQ7_KbM0eeowXNgul_fieOg&format=msgpack
11
-2021-08-10 16:29:30.217 +02:00 [Information] Connected to ws://192.168.1.54:8080/ws?dsId=RTSP-kmS3ZynUOMIfzu1iULqqkTVS9SjCbL8iVeCkne0XCe0&auth=vKUt6sCqqK4mOVAHm1qLyQ7_KbM0eeowXNgul_fieOg&format=msgpack

+ 15
- 0
RSTP_DSLink/RSTP_DSLink/bin/Release/netcoreapp3.1/log-20210906.txt View File

1
+2021-09-06 15:33:03.853 +02:00 [Information] Handshaking with http://192.168.1.109:8080/conn?dsId=RTSP-kmS3ZynUOMIfzu1iULqqkTVS9SjCbL8iVeCkne0XCe0
2
+2021-09-06 15:33:04.643 +02:00 [Information] Handshake successful
3
+2021-09-06 15:33:05.493 +02:00 [Information] Connecting
4
+2021-09-06 15:33:05.522 +02:00 [Information] WebSocket connecting to ws://192.168.1.109:8080/ws?dsId=RTSP-kmS3ZynUOMIfzu1iULqqkTVS9SjCbL8iVeCkne0XCe0&auth=2UXejr2SrpfomdyIDqt-3823mmjkcwEYFf9PQ1DOdAs&format=msgpack
5
+2021-09-06 15:33:05.648 +02:00 [Information] Connected to ws://192.168.1.109:8080/ws?dsId=RTSP-kmS3ZynUOMIfzu1iULqqkTVS9SjCbL8iVeCkne0XCe0&auth=2UXejr2SrpfomdyIDqt-3823mmjkcwEYFf9PQ1DOdAs&format=msgpack
6
+2021-09-06 15:33:29.175 +02:00 [Information] Handshaking with http://192.168.1.109:8080/conn?dsId=RTSP-kmS3ZynUOMIfzu1iULqqkTVS9SjCbL8iVeCkne0XCe0
7
+2021-09-06 15:33:29.653 +02:00 [Information] Handshake successful
8
+2021-09-06 15:33:29.875 +02:00 [Information] Connecting
9
+2021-09-06 15:33:29.908 +02:00 [Information] WebSocket connecting to ws://192.168.1.109:8080/ws?dsId=RTSP-kmS3ZynUOMIfzu1iULqqkTVS9SjCbL8iVeCkne0XCe0&auth=r1im0BOLksfcC62NHTWzpJOCcHil1_W4ujB1ceVmtc4&format=msgpack
10
+2021-09-06 15:33:29.964 +02:00 [Information] Connected to ws://192.168.1.109:8080/ws?dsId=RTSP-kmS3ZynUOMIfzu1iULqqkTVS9SjCbL8iVeCkne0XCe0&auth=r1im0BOLksfcC62NHTWzpJOCcHil1_W4ujB1ceVmtc4&format=msgpack
11
+2021-09-06 15:37:37.854 +02:00 [Information] Handshaking with http://192.168.1.109:8080/conn?dsId=RTSP-kmS3ZynUOMIfzu1iULqqkTVS9SjCbL8iVeCkne0XCe0
12
+2021-09-06 15:37:38.268 +02:00 [Information] Handshake successful
13
+2021-09-06 15:37:38.531 +02:00 [Information] Connecting
14
+2021-09-06 15:37:38.608 +02:00 [Information] WebSocket connecting to ws://192.168.1.109:8080/ws?dsId=RTSP-kmS3ZynUOMIfzu1iULqqkTVS9SjCbL8iVeCkne0XCe0&auth=eZMCBjpHeum-FAGADBH1E4xZ0DIn3T00dmc8cSh10mc&format=msgpack
15
+2021-09-06 15:37:38.703 +02:00 [Information] Connected to ws://192.168.1.109:8080/ws?dsId=RTSP-kmS3ZynUOMIfzu1iULqqkTVS9SjCbL8iVeCkne0XCe0&auth=eZMCBjpHeum-FAGADBH1E4xZ0DIn3T00dmc8cSh10mc&format=msgpack

RSTP_DSLink/log-20210811.txt → RSTP_DSLink/RSTP_DSLink/bin/Release/netcoreapp3.1/log-20210907.txt View File

1
-2021-08-11 09:22:15.404 +02:00 [Information] Handshaking with http://192.168.1.54:8080/conn?dsId=RTSP-LVHIFD8Yqt1CIfLypVNnn8lDhrTHfJ-mbFNvADcENyk
2
-2021-08-11 09:22:15.836 +02:00 [Information] Handshake successful
3
-2021-08-11 09:22:15.930 +02:00 [Information] Connecting
4
-2021-08-11 09:22:15.958 +02:00 [Information] WebSocket connecting to ws://192.168.1.54:8080/ws?dsId=RTSP-LVHIFD8Yqt1CIfLypVNnn8lDhrTHfJ-mbFNvADcENyk&auth=-5UqwsCcQAqr0JBT5RhHrlj5R2bU5BpyyBpA1u0r4zQ&format=msgpack
5
-2021-08-11 09:22:16.008 +02:00 [Information] Connected to ws://192.168.1.54:8080/ws?dsId=RTSP-LVHIFD8Yqt1CIfLypVNnn8lDhrTHfJ-mbFNvADcENyk&auth=-5UqwsCcQAqr0JBT5RhHrlj5R2bU5BpyyBpA1u0r4zQ&format=msgpack
6
-2021-08-11 19:37:17.941 +02:00 [Error] Exception processing message from web socket.
1
+2021-09-07 09:09:29.720 +02:00 [Error] Exception processing message from web socket.
7
 System.Net.WebSockets.WebSocketException (0x80004005): The remote party closed the WebSocket connection without completing the close handshake.
2
 System.Net.WebSockets.WebSocketException (0x80004005): The remote party closed the WebSocket connection without completing the close handshake.
8
  ---> System.IO.IOException: Unable to read data from the transport connection: Une tentative de connexion a échoué car le parti connecté n’a pas répondu convenablement au-delà d’une certaine durée ou une connexion établie a échoué car l’hôte de connexion n’a pas répondu..
3
  ---> System.IO.IOException: Unable to read data from the transport connection: Une tentative de connexion a échoué car le parti connecté n’a pas répondu convenablement au-delà d’une certaine durée ou une connexion établie a échoué car l’hôte de connexion n’a pas répondu..
9
  ---> System.Net.Sockets.SocketException (10060): Une tentative de connexion a échoué car le parti connecté n’a pas répondu convenablement au-delà d’une certaine durée ou une connexion établie a échoué car l’hôte de connexion n’a pas répondu.
4
  ---> System.Net.Sockets.SocketException (10060): Une tentative de connexion a échoué car le parti connecté n’a pas répondu convenablement au-delà d’une certaine durée ou une connexion établie a échoué car l’hôte de connexion n’a pas répondu.
16
    at System.Net.WebSockets.ManagedWebSocket.ReceiveAsyncPrivate[TWebSocketReceiveResultGetter,TWebSocketReceiveResult](Memory`1 payloadBuffer, CancellationToken cancellationToken, TWebSocketReceiveResultGetter resultGetter)
11
    at System.Net.WebSockets.ManagedWebSocket.ReceiveAsyncPrivate[TWebSocketReceiveResultGetter,TWebSocketReceiveResult](Memory`1 payloadBuffer, CancellationToken cancellationToken, TWebSocketReceiveResultGetter resultGetter)
17
    at System.Net.WebSockets.ManagedWebSocket.ReceiveAsyncPrivate[TWebSocketReceiveResultGetter,TWebSocketReceiveResult](Memory`1 payloadBuffer, CancellationToken cancellationToken, TWebSocketReceiveResultGetter resultGetter)
12
    at System.Net.WebSockets.ManagedWebSocket.ReceiveAsyncPrivate[TWebSocketReceiveResultGetter,TWebSocketReceiveResult](Memory`1 payloadBuffer, CancellationToken cancellationToken, TWebSocketReceiveResultGetter resultGetter)
18
    at DSLink.Connection.WebSocketConnector.<_startReceiveTask>b__11_0()
13
    at DSLink.Connection.WebSocketConnector.<_startReceiveTask>b__11_0()
19
-2021-08-11 19:37:18.436 +02:00 [Information] Disconnected
20
-2021-08-11 19:37:18.443 +02:00 [Information] Handshaking with http://192.168.1.54:8080/conn?dsId=RTSP-LVHIFD8Yqt1CIfLypVNnn8lDhrTHfJ-mbFNvADcENyk
21
-2021-08-11 19:37:18.468 +02:00 [Information] Disconnecting
22
-2021-08-11 19:37:18.597 +02:00 [Information] Handshake successful
23
-2021-08-11 19:37:18.609 +02:00 [Information] Connecting
24
-2021-08-11 19:37:18.633 +02:00 [Information] WebSocket connecting to ws://192.168.1.54:8080/ws?dsId=RTSP-LVHIFD8Yqt1CIfLypVNnn8lDhrTHfJ-mbFNvADcENyk&auth=b1d4m92tOSp-W-KJvqwTUY-299irD8Q0Nn-fv2rDh9U&format=msgpack
25
-2021-08-11 19:37:18.682 +02:00 [Information] Connected to ws://192.168.1.54:8080/ws?dsId=RTSP-LVHIFD8Yqt1CIfLypVNnn8lDhrTHfJ-mbFNvADcENyk&auth=b1d4m92tOSp-W-KJvqwTUY-299irD8Q0Nn-fv2rDh9U&format=msgpack
14
+2021-09-07 09:09:30.532 +02:00 [Information] Disconnected
15
+2021-09-07 09:09:30.556 +02:00 [Information] Handshaking with http://192.168.1.109:8080/conn?dsId=RTSP-kmS3ZynUOMIfzu1iULqqkTVS9SjCbL8iVeCkne0XCe0
16
+2021-09-07 09:09:30.705 +02:00 [Information] Disconnecting
17
+2021-09-07 09:09:30.842 +02:00 [Information] Handshake successful
18
+2021-09-07 09:09:30.850 +02:00 [Information] Connecting
19
+2021-09-07 09:09:30.873 +02:00 [Information] WebSocket connecting to ws://192.168.1.109:8080/ws?dsId=RTSP-kmS3ZynUOMIfzu1iULqqkTVS9SjCbL8iVeCkne0XCe0&auth=R-ji6Qh4QOyxoH0ug8nxUNBwP92A1EjcOTJ654cEaIs&format=msgpack
20
+2021-09-07 09:09:30.938 +02:00 [Information] Connected to ws://192.168.1.109:8080/ws?dsId=RTSP-kmS3ZynUOMIfzu1iULqqkTVS9SjCbL8iVeCkne0XCe0&auth=R-ji6Qh4QOyxoH0ug8nxUNBwP92A1EjcOTJ654cEaIs&format=msgpack

+ 25
- 0
RSTP_DSLink/RSTP_DSLink/bin/Release/netcoreapp3.1/log-20210908.txt View File

1
+2021-09-08 08:34:35.050 +02:00 [Error] Exception processing message from web socket.
2
+System.Net.WebSockets.WebSocketException (0x80004005): The remote party closed the WebSocket connection without completing the close handshake.
3
+ ---> System.IO.IOException: Unable to read data from the transport connection: Une tentative de connexion a échoué car le parti connecté n’a pas répondu convenablement au-delà d’une certaine durée ou une connexion établie a échoué car l’hôte de connexion n’a pas répondu..
4
+ ---> System.Net.Sockets.SocketException (10060): Une tentative de connexion a échoué car le parti connecté n’a pas répondu convenablement au-delà d’une certaine durée ou une connexion établie a échoué car l’hôte de connexion n’a pas répondu.
5
+   --- End of inner exception stack trace ---
6
+   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
7
+   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.GetResult(Int16 token)
8
+   at System.Net.Http.HttpConnection.ReadBufferedAsyncCore(Memory`1 destination)
9
+   at System.Net.Http.HttpConnection.RawConnectionStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken)
10
+   at System.Net.WebSockets.ManagedWebSocket.EnsureBufferContainsAsync(Int32 minimumRequiredBytes, CancellationToken cancellationToken, Boolean throwOnPrematureClosure)
11
+   at System.Net.WebSockets.ManagedWebSocket.ReceiveAsyncPrivate[TWebSocketReceiveResultGetter,TWebSocketReceiveResult](Memory`1 payloadBuffer, CancellationToken cancellationToken, TWebSocketReceiveResultGetter resultGetter)
12
+   at System.Net.WebSockets.ManagedWebSocket.ReceiveAsyncPrivate[TWebSocketReceiveResultGetter,TWebSocketReceiveResult](Memory`1 payloadBuffer, CancellationToken cancellationToken, TWebSocketReceiveResultGetter resultGetter)
13
+   at DSLink.Connection.WebSocketConnector.<_startReceiveTask>b__11_0()
14
+2021-09-08 08:34:40.255 +02:00 [Information] Disconnected
15
+2021-09-08 08:34:40.407 +02:00 [Information] Handshaking with http://192.168.1.109:8080/conn?dsId=RTSP-kmS3ZynUOMIfzu1iULqqkTVS9SjCbL8iVeCkne0XCe0
16
+2021-09-08 08:34:40.983 +02:00 [Information] Disconnecting
17
+2021-09-08 08:34:41.159 +02:00 [Information] Handshake successful
18
+2021-09-08 08:34:41.312 +02:00 [Information] Connecting
19
+2021-09-08 08:34:41.466 +02:00 [Information] WebSocket connecting to ws://192.168.1.109:8080/ws?dsId=RTSP-kmS3ZynUOMIfzu1iULqqkTVS9SjCbL8iVeCkne0XCe0&auth=NVKLWsgKEtF_0VXYfD-SWND4sOF4LUdzVx9dRfGy7R4&format=msgpack
20
+2021-09-08 08:34:41.854 +02:00 [Information] Connected to ws://192.168.1.109:8080/ws?dsId=RTSP-kmS3ZynUOMIfzu1iULqqkTVS9SjCbL8iVeCkne0XCe0&auth=NVKLWsgKEtF_0VXYfD-SWND4sOF4LUdzVx9dRfGy7R4&format=msgpack
21
+2021-09-08 08:41:09.885 +02:00 [Information] Handshaking with http://192.168.1.109:8080/conn?dsId=RTSP-kmS3ZynUOMIfzu1iULqqkTVS9SjCbL8iVeCkne0XCe0
22
+2021-09-08 08:41:11.675 +02:00 [Information] Handshake successful
23
+2021-09-08 08:41:12.854 +02:00 [Information] Connecting
24
+2021-09-08 08:41:12.903 +02:00 [Information] WebSocket connecting to ws://192.168.1.109:8080/ws?dsId=RTSP-kmS3ZynUOMIfzu1iULqqkTVS9SjCbL8iVeCkne0XCe0&auth=IqZhuB6UJYq4Z6g5e5mj-uqa5HR5pCFY5rbJBqT53P8&format=msgpack
25
+2021-09-08 08:41:13.075 +02:00 [Information] Connected to ws://192.168.1.109:8080/ws?dsId=RTSP-kmS3ZynUOMIfzu1iULqqkTVS9SjCbL8iVeCkne0XCe0&auth=IqZhuB6UJYq4Z6g5e5mj-uqa5HR5pCFY5rbJBqT53P8&format=msgpack

BIN
RSTP_DSLink/RSTP_DSLink/obj/Release/netcoreapp3.1/RSTP_DSLink.csproj.AssemblyReference.cache View File


BIN
RSTP_DSLink/RSTP_DSLink/obj/Release/netcoreapp3.1/RSTP_DSLink.dll View File


BIN
RSTP_DSLink/RSTP_DSLink/obj/Release/netcoreapp3.1/RSTP_DSLink.pdb View File


+ 1
- 0
RSTP_DSLink/log-20210906.txt View File

1
+2021-09-06 15:17:31.562 +02:00 [Information] Handshaking with http://localhost:8080/conn?dsId=RTSP-LVHIFD8Yqt1CIfLypVNnn8lDhrTHfJ-mbFNvADcENyk

Loading…
Cancel
Save