holado 0.4.1__py3-none-any.whl → 0.5.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of holado might be problematic. Click here for more details.
- holado/common/context/session_context.py +6 -0
- holado/common/handlers/object.py +6 -0
- {holado-0.4.1.dist-info → holado-0.5.2.dist-info}/METADATA +2 -1
- {holado-0.4.1.dist-info → holado-0.5.2.dist-info}/RECORD +93 -43
- holado_ais/ais/ais_messages.py +44 -15
- holado_ais/ais/patch_pyais.py +47 -176
- holado_ais/tests/behave/steps/ais/ais_messages_steps.py +2 -6
- holado_core/common/resource/persisted_data_manager.py +4 -5
- holado_core/common/resource/resource_manager.py +4 -18
- holado_core/common/tools/converters/converter.py +14 -3
- holado_core/common/tools/tools.py +9 -2
- holado_core/tools/abstracts/blocking_command_service.py +9 -1
- holado_data/data/generator/generator_manager.py +1 -13
- holado_db/tools/db/clients/base/db_audit.py +94 -0
- holado_db/tools/db/clients/base/db_client.py +145 -59
- holado_db/tools/db/clients/postgresql/postgresql_audit.py +75 -0
- holado_db/tools/db/clients/postgresql/postgresql_client.py +4 -0
- holado_db/tools/db/clients/sqlite/sqlite_audit.py +70 -0
- holado_db/tools/db/clients/sqlite/sqlite_client.py +4 -0
- holado_django/__init__.py +31 -0
- holado_django/server/HOWTO.txt +27 -0
- holado_django/server/django_projects/rest_api/db.sqlite3 +0 -0
- holado_django/server/django_projects/rest_api/manage.py +22 -0
- holado_django/server/django_projects/rest_api/rest_api/__init__.py +0 -0
- holado_django/server/django_projects/rest_api/rest_api/application/__init__.py +0 -0
- holado_django/server/django_projects/rest_api/rest_api/application/admin.py +3 -0
- holado_django/server/django_projects/rest_api/rest_api/application/apps.py +9 -0
- holado_django/server/django_projects/rest_api/rest_api/application/migrations/__init__.py +0 -0
- holado_django/server/django_projects/rest_api/rest_api/application/models.py +3 -0
- holado_django/server/django_projects/rest_api/rest_api/application/tests.py +3 -0
- holado_django/server/django_projects/rest_api/rest_api/application/views.py +6 -0
- holado_django/server/django_projects/rest_api/rest_api/asgi.py +16 -0
- holado_django/server/django_projects/rest_api/rest_api/settings.py +130 -0
- holado_django/server/django_projects/rest_api/rest_api/urls.py +35 -0
- holado_django/server/django_projects/rest_api/rest_api/wsgi.py +16 -0
- holado_django/server/django_server.py +110 -0
- holado_django/server/grpc_django_server.py +57 -0
- holado_django/server/patch_djangogrpcframework.py +46 -0
- holado_django/tests/behave/steps/__init__.py +16 -0
- holado_django/tests/behave/steps/django_server_steps.py +83 -0
- holado_grpc/tests/behave/steps/private/api/grpc_steps.py +9 -9
- holado_logging/common/logging/holado_logger.py +1 -6
- holado_multitask/multitasking/multitask_manager.py +36 -10
- holado_multitask/multithreading/thread.py +13 -7
- holado_multitask/multithreading/timer.py +3 -0
- holado_python/common/tools/datetime.py +31 -13
- holado_python/standard_library/ssl/resources/certificates/tcpbin.crt +16 -16
- holado_python/standard_library/ssl/resources/certificates/tcpbin.key +26 -26
- holado_rabbitmq/tools/rabbitmq/rabbitmq_blocking_client.py +24 -2
- holado_rabbitmq/tools/rabbitmq/rabbitmq_client.py +2 -2
- holado_report/report/builders/failure_report_builder.py +129 -0
- holado_report/report/report_manager.py +4 -0
- holado_rest/api/rest/TODO.txt +1 -1
- holado_rest/api/rest/rest_client.py +19 -7
- holado_rest/tests/behave/steps/api/rest_client_steps.py +1 -2
- holado_rest/tests/behave/steps/private/api/rest_steps.py +11 -13
- holado_system/system/command/command.py +31 -9
- holado_system/system/global_system.py +3 -3
- test_holado/environment.py +6 -4
- test_holado/features/NonReg/api/REST.feature +7 -2
- test_holado/features/NonReg/api/gRPC.feature +0 -6
- test_holado/features/NonReg/holado_ais/message_types/type-10.feature +38 -0
- test_holado/features/NonReg/holado_ais/message_types/type-12.feature +37 -0
- test_holado/features/NonReg/holado_ais/message_types/type-14.feature +36 -0
- test_holado/features/NonReg/holado_ais/message_types/type-15.feature +36 -0
- test_holado/features/NonReg/holado_ais/message_types/type-16.feature +38 -0
- test_holado/features/NonReg/holado_ais/message_types/type-17.feature +46 -0
- test_holado/features/NonReg/holado_ais/message_types/type-18.feature +37 -0
- test_holado/features/NonReg/holado_ais/message_types/type-19.feature +38 -0
- test_holado/features/NonReg/holado_ais/message_types/type-1_2_3.feature +42 -0
- test_holado/features/NonReg/holado_ais/message_types/type-20.feature +38 -0
- test_holado/features/NonReg/holado_ais/message_types/type-21.feature +37 -0
- test_holado/features/NonReg/holado_ais/message_types/type-22.feature +84 -0
- test_holado/features/NonReg/holado_ais/message_types/type-23.feature +49 -0
- test_holado/features/NonReg/holado_ais/message_types/type-24.feature +72 -0
- test_holado/features/NonReg/holado_ais/message_types/type-25.feature +143 -0
- test_holado/features/NonReg/holado_ais/message_types/type-26.feature +144 -0
- test_holado/features/NonReg/holado_ais/message_types/type-27.feature +36 -0
- test_holado/features/NonReg/holado_ais/message_types/type-4_11.feature +39 -0
- test_holado/features/NonReg/holado_ais/message_types/type-5.feature +33 -0
- test_holado/features/NonReg/holado_ais/message_types/type-6.feature +37 -0
- test_holado/features/NonReg/holado_ais/message_types/type-7_13.feature +43 -0
- test_holado/features/NonReg/holado_ais/message_types/type-8.feature +37 -0
- test_holado/features/NonReg/holado_ais/message_types/type-9.feature +37 -0
- test_holado/initialize_holado.py +62 -0
- test_holado/logging.conf +3 -0
- test_holado/tools/django/api_grpc/manage.py +2 -0
- test_holado/tools/django/api_grpc/patch_djangogrpcframework.py +42 -0
- test_holado/tools/django/api_rest/db.sqlite3 +0 -0
- {holado-0.4.1.dist-info → holado-0.5.2.dist-info}/WHEEL +0 -0
- {holado-0.4.1.dist-info → holado-0.5.2.dist-info}/licenses/LICENSE +0 -0
- /holado_helper/holado_module_template/{test → tests}/behave/steps/__init__.py +0 -0
- /holado_helper/holado_module_template/{test → tests}/behave/steps/private/__init__.py +0 -0
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
@rest
|
|
3
3
|
Feature: Test REST module
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
@need_update
|
|
5
|
+
#@need_update
|
|
7
6
|
Scenario: Simple get
|
|
8
7
|
|
|
9
8
|
### PRECONDITIONS - BEGIN
|
|
@@ -18,4 +17,10 @@ Feature: Test REST module
|
|
|
18
17
|
|
|
19
18
|
When RESULT = get '/users' (REST client: CLIENT)
|
|
20
19
|
Then RESULT['results'] is list
|
|
20
|
+
|
|
21
|
+
Given TABLE = convert json RESULT['results'] to table with names as columns
|
|
22
|
+
Then table TABLE contains
|
|
23
|
+
| email | groups | url | username |
|
|
24
|
+
| N/A | N/A | N/A | 'admin' |
|
|
25
|
+
|
|
21
26
|
|
|
@@ -9,8 +9,6 @@ Feature: Test gRPC module
|
|
|
9
9
|
Given begin preconditions
|
|
10
10
|
|
|
11
11
|
Given SERVER = start internal gRPC server
|
|
12
|
-
When wait 1 seconds
|
|
13
|
-
|
|
14
12
|
Given CLIENT = new internal gRPC client on service 'account.UserController'
|
|
15
13
|
|
|
16
14
|
Given end preconditions
|
|
@@ -33,8 +31,6 @@ Feature: Test gRPC module
|
|
|
33
31
|
Given begin preconditions
|
|
34
32
|
|
|
35
33
|
Given SERVER = start internal gRPC server
|
|
36
|
-
When wait 1 seconds
|
|
37
|
-
|
|
38
34
|
Given CLIENT = new internal gRPC client on service 'account.UserController'
|
|
39
35
|
|
|
40
36
|
Given end preconditions
|
|
@@ -78,8 +74,6 @@ Feature: Test gRPC module
|
|
|
78
74
|
Given begin preconditions
|
|
79
75
|
|
|
80
76
|
Given SERVER = start internal gRPC server
|
|
81
|
-
When wait 1 seconds
|
|
82
|
-
|
|
83
77
|
Given CLIENT = new internal gRPC client on service 'account.UserController'
|
|
84
78
|
|
|
85
79
|
Given end preconditions
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
@ais
|
|
2
|
+
@type_10
|
|
3
|
+
Feature: Message type 10 : Coordinated UTC Inquiry
|
|
4
|
+
|
|
5
|
+
Scenario: Create, convert, encode and decode message
|
|
6
|
+
# Create message
|
|
7
|
+
When MESSAGE = new AIS message of type 'T10_COORDINATED_UTC_INQUIRY'
|
|
8
|
+
| repeat | mmsi | dest_mmsi |
|
|
9
|
+
| 1 | 235006280 | 23200002 |
|
|
10
|
+
|
|
11
|
+
# Verify bytes conversion
|
|
12
|
+
When MESSAGE_TO_BYTES = convert AIS message MESSAGE to bytes
|
|
13
|
+
When MESSAGE_BYTES = new AIS message of type 'T10_COORDINATED_UTC_INQUIRY' as bitarray bytes
|
|
14
|
+
| repeat | mmsi | dest_mmsi |
|
|
15
|
+
| 1 | 235006280 | 23200002 |
|
|
16
|
+
Then MESSAGE_TO_BYTES == MESSAGE_BYTES
|
|
17
|
+
|
|
18
|
+
# Encode in NMEA
|
|
19
|
+
When NMEA_SENTENCES = encode AIS raw payload MESSAGE_BYTES to NMEA
|
|
20
|
+
| talker_id | radio_channel | seq_id | group_id |
|
|
21
|
+
| 'AIVDM' | 'A' | 0 | 0 |
|
|
22
|
+
Then ${len(NMEA_SENTENCES)} == 1
|
|
23
|
+
|
|
24
|
+
# Verify some NMEA fields
|
|
25
|
+
Given STRING_NMEA_MSG = split NMEA AIS message NMEA_SENTENCES[0] to fields
|
|
26
|
+
Then STRING_NMEA_MSG[-3] == 'A'
|
|
27
|
+
|
|
28
|
+
# Decode NMEA message
|
|
29
|
+
Given DECODED_NMEA_MESSAGE = decode NMEA AIS message NMEA_SENTENCES as dictionnary
|
|
30
|
+
When DECODED_NMEA_MESSAGE_TABLE = convert dictionary DECODED_NMEA_MESSAGE to table with keys as columns
|
|
31
|
+
Then table DECODED_NMEA_MESSAGE_TABLE is
|
|
32
|
+
| dest_mmsi | mmsi | msg_type | repeat |
|
|
33
|
+
| 23200002 | 235006280 | 10 | 1 |
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
@ais
|
|
2
|
+
@type_12
|
|
3
|
+
Feature: Message type 12 : Addressed Safety Related Message
|
|
4
|
+
|
|
5
|
+
Scenario: Create, convert, encode and decode message
|
|
6
|
+
# Create message
|
|
7
|
+
When MESSAGE = new AIS message of type 'T12_ADDRESSED_SAFETY_RELATED_MESSAGE'
|
|
8
|
+
| repeat | mmsi | seqno | dest_mmsi | retransmit | text |
|
|
9
|
+
| 1 | 235006280 | 3 | 23200002 | True | 'TYPE 12' |
|
|
10
|
+
|
|
11
|
+
# Verify bytes conversion
|
|
12
|
+
When MESSAGE_TO_BYTES = convert AIS message MESSAGE to bytes
|
|
13
|
+
When MESSAGE_BYTES = new AIS message of type 'T12_ADDRESSED_SAFETY_RELATED_MESSAGE' as bitarray bytes
|
|
14
|
+
| repeat | mmsi | seqno | dest_mmsi | retransmit | text |
|
|
15
|
+
| 1 | 235006280 | 3 | 23200002 | True | 'TYPE 12' |
|
|
16
|
+
Then MESSAGE_TO_BYTES == MESSAGE_BYTES
|
|
17
|
+
|
|
18
|
+
# Encode in NMEA
|
|
19
|
+
When NMEA_SENTENCES = encode AIS raw payload MESSAGE_BYTES to NMEA
|
|
20
|
+
| talker_id | radio_channel | seq_id | group_id |
|
|
21
|
+
| 'AIVDM' | 'A' | 0 | 0 |
|
|
22
|
+
Then ${len(NMEA_SENTENCES)} == 1
|
|
23
|
+
|
|
24
|
+
# Verify some NMEA fields
|
|
25
|
+
Given STRING_NMEA_MSG = split NMEA AIS message NMEA_SENTENCES[0] to fields
|
|
26
|
+
Then STRING_NMEA_MSG[-3] == 'A'
|
|
27
|
+
|
|
28
|
+
# Decode NMEA message
|
|
29
|
+
Given DECODED_NMEA_MESSAGE = decode NMEA AIS message NMEA_SENTENCES as dictionnary
|
|
30
|
+
When DECODED_NMEA_MESSAGE_TABLE = convert dictionary DECODED_NMEA_MESSAGE to table with keys as columns
|
|
31
|
+
Then table DECODED_NMEA_MESSAGE_TABLE is
|
|
32
|
+
| dest_mmsi | mmsi | msg_type | repeat | retransmit | seqno | text |
|
|
33
|
+
| 23200002 | 235006280 | 12 | 1 | True | 3 | 'TYPE 12' |
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
@ais
|
|
2
|
+
@type_14
|
|
3
|
+
Feature: Message type 14 : Safety Related Broadcast Message
|
|
4
|
+
|
|
5
|
+
Scenario: Create, convert, encode and decode message
|
|
6
|
+
# Create message
|
|
7
|
+
When MESSAGE = new AIS message of type 'T14_SAFETY_RELATED_BROADCAST_MESSAGE'
|
|
8
|
+
| repeat | mmsi | text |
|
|
9
|
+
| 1 | 235006280 | 'Test for type 14' |
|
|
10
|
+
|
|
11
|
+
# Verify bytes conversion
|
|
12
|
+
When MESSAGE_TO_BYTES = convert AIS message MESSAGE to bytes
|
|
13
|
+
When MESSAGE_BYTES = new AIS message of type 'T14_SAFETY_RELATED_BROADCAST_MESSAGE' as bitarray bytes
|
|
14
|
+
| repeat | mmsi | text |
|
|
15
|
+
| 1 | 235006280 | 'Test for type 14' |
|
|
16
|
+
Then MESSAGE_TO_BYTES == MESSAGE_BYTES
|
|
17
|
+
|
|
18
|
+
# Encode in NMEA
|
|
19
|
+
When NMEA_SENTENCES = encode AIS raw payload MESSAGE_BYTES to NMEA
|
|
20
|
+
| talker_id | radio_channel | seq_id | group_id |
|
|
21
|
+
| 'AIVDM' | 'A' | 0 | 0 |
|
|
22
|
+
Then ${len(NMEA_SENTENCES)} == 1
|
|
23
|
+
|
|
24
|
+
# Verify some NMEA fields
|
|
25
|
+
Given STRING_NMEA_MSG = split NMEA AIS message NMEA_SENTENCES[0] to fields
|
|
26
|
+
Then STRING_NMEA_MSG[-3] == 'A'
|
|
27
|
+
|
|
28
|
+
# Decode NMEA message
|
|
29
|
+
Given DECODED_NMEA_MESSAGE = decode NMEA AIS message NMEA_SENTENCES as dictionnary
|
|
30
|
+
When DECODED_NMEA_MESSAGE_TABLE = convert dictionary DECODED_NMEA_MESSAGE to table with keys as columns
|
|
31
|
+
Then table DECODED_NMEA_MESSAGE_TABLE is
|
|
32
|
+
| mmsi | msg_type | repeat | text |
|
|
33
|
+
| 235006280 | 14 | 1 | 'TEST FOR TYPE 14' |
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
@ais
|
|
2
|
+
@type_15
|
|
3
|
+
Feature: Message type 15 : Interrogation
|
|
4
|
+
|
|
5
|
+
Scenario: Create, convert, encode and decode message
|
|
6
|
+
# Create message
|
|
7
|
+
When MESSAGE = new AIS message of type 'T15_INTERROGATION'
|
|
8
|
+
| repeat | mmsi | mmsi1 | type1_1 | offset1_1 | type1_2 | offset1_2 | mmsi2 | type2_1 | offset2_1 |
|
|
9
|
+
| 1 | 235006280 | 23200001 | 1 | 1000 | 27 | 2000 | 23200002 | 30 | 3000 |
|
|
10
|
+
|
|
11
|
+
# Verify bytes conversion
|
|
12
|
+
When MESSAGE_TO_BYTES = convert AIS message MESSAGE to bytes
|
|
13
|
+
When MESSAGE_BYTES = new AIS message of type 'T15_INTERROGATION' as bitarray bytes
|
|
14
|
+
| repeat | mmsi | mmsi1 | type1_1 | offset1_1 | type1_2 | offset1_2 | mmsi2 | type2_1 | offset2_1 |
|
|
15
|
+
| 1 | 235006280 | 23200001 | 1 | 1000 | 27 | 2000 | 23200002 | 30 | 3000 |
|
|
16
|
+
Then MESSAGE_TO_BYTES == MESSAGE_BYTES
|
|
17
|
+
|
|
18
|
+
# Encode in NMEA
|
|
19
|
+
When NMEA_SENTENCES = encode AIS raw payload MESSAGE_BYTES to NMEA
|
|
20
|
+
| talker_id | radio_channel | seq_id | group_id |
|
|
21
|
+
| 'AIVDM' | 'A' | 0 | 0 |
|
|
22
|
+
Then ${len(NMEA_SENTENCES)} == 1
|
|
23
|
+
|
|
24
|
+
# Verify some NMEA fields
|
|
25
|
+
Given STRING_NMEA_MSG = split NMEA AIS message NMEA_SENTENCES[0] to fields
|
|
26
|
+
Then STRING_NMEA_MSG[-3] == 'A'
|
|
27
|
+
|
|
28
|
+
# Decode NMEA message
|
|
29
|
+
Given DECODED_NMEA_MESSAGE = decode NMEA AIS message NMEA_SENTENCES as dictionnary
|
|
30
|
+
When DECODED_NMEA_MESSAGE_TABLE = convert dictionary DECODED_NMEA_MESSAGE to table with keys as columns
|
|
31
|
+
Then table DECODED_NMEA_MESSAGE_TABLE is
|
|
32
|
+
| mmsi | mmsi1 | mmsi2 | msg_type | offset1_1 | offset1_2 | offset2_1 | repeat | type1_1 | type1_2 | type2_1 |
|
|
33
|
+
| 235006280 | 23200001 | 23200002 | 15 | 1000 | 2000 | 3000 | 1 | 1 | 27 | 30 |
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
@ais
|
|
2
|
+
@type_16
|
|
3
|
+
Feature: Message type 16 : Assigned Mode Command
|
|
4
|
+
|
|
5
|
+
Scenario: Create, convert, encode and decode message
|
|
6
|
+
# Create message
|
|
7
|
+
When MESSAGE = new AIS message of type 'T16_ASSIGNED_MODE_COMMAND'
|
|
8
|
+
| repeat | mmsi | mmsi1 | offset1 | increment1 | mmsi2 | offset2 | increment2 |
|
|
9
|
+
| 1 | 235006280 | 232 | 501 | 1001 | 23200002 | 102 | 1002 |
|
|
10
|
+
|
|
11
|
+
# Verify bytes conversion
|
|
12
|
+
When MESSAGE_TO_BYTES = convert AIS message MESSAGE to bytes
|
|
13
|
+
When MESSAGE_BYTES = new AIS message of type 'T16_ASSIGNED_MODE_COMMAND' as bitarray bytes
|
|
14
|
+
| repeat | mmsi | mmsi1 | offset1 | increment1 | mmsi2 | offset2 | increment2 |
|
|
15
|
+
| 1 | 235006280 | 232 | 501 | 1001 | 23200002 | 102 | 1002 |
|
|
16
|
+
Then MESSAGE_TO_BYTES == MESSAGE_BYTES
|
|
17
|
+
|
|
18
|
+
# Encode in NMEA
|
|
19
|
+
When NMEA_SENTENCES = encode AIS raw payload MESSAGE_BYTES to NMEA
|
|
20
|
+
| talker_id | radio_channel | seq_id | group_id |
|
|
21
|
+
| 'AIVDM' | 'A' | 0 | 0 |
|
|
22
|
+
Then ${len(NMEA_SENTENCES)} == 1
|
|
23
|
+
|
|
24
|
+
# Verify some NMEA fields
|
|
25
|
+
Given STRING_NMEA_MSG = split NMEA AIS message NMEA_SENTENCES[0] to fields
|
|
26
|
+
Then STRING_NMEA_MSG[-3] == 'A'
|
|
27
|
+
|
|
28
|
+
# Decode NMEA message
|
|
29
|
+
Given DECODED_NMEA_MESSAGE = decode NMEA AIS message NMEA_SENTENCES as dictionnary
|
|
30
|
+
When DECODED_NMEA_MESSAGE_TABLE = convert dictionary DECODED_NMEA_MESSAGE to table with keys as columns
|
|
31
|
+
Then table DECODED_NMEA_MESSAGE_TABLE is
|
|
32
|
+
| increment1 | increment2 | mmsi | mmsi1 | mmsi2 | msg_type | offset1 | offset2 | repeat |
|
|
33
|
+
| 1001 | 1002 | 235006280 | 232 | 23200002 | 16 | 501 | 102 | 1 |
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
@ais
|
|
2
|
+
@type_17
|
|
3
|
+
Feature: Message type 17 : GNSS Broadcast Binary Message
|
|
4
|
+
|
|
5
|
+
Scenario: Create, convert, encode and decode message
|
|
6
|
+
### PRECONDITIONS - BEGIN
|
|
7
|
+
Given begin preconditions
|
|
8
|
+
|
|
9
|
+
Given LON = 90.5
|
|
10
|
+
Given LAT = 44.5
|
|
11
|
+
|
|
12
|
+
Given end preconditions
|
|
13
|
+
### PRECONDITIONS - END
|
|
14
|
+
|
|
15
|
+
# Create message
|
|
16
|
+
When MESSAGE = new AIS message of type 'T17_GNSS_BROADCAST_BINARY_MESSAGE'
|
|
17
|
+
| repeat | mmsi | lon | lat | data |
|
|
18
|
+
| 1 | 235006280 | LON | LAT | b'1' |
|
|
19
|
+
|
|
20
|
+
# Verify bytes conversion
|
|
21
|
+
When MESSAGE_TO_BYTES = convert AIS message MESSAGE to bytes
|
|
22
|
+
When MESSAGE_BYTES = new AIS message of type 'T17_GNSS_BROADCAST_BINARY_MESSAGE' as bitarray bytes
|
|
23
|
+
| repeat | mmsi | lon | lat | data |
|
|
24
|
+
| 1 | 235006280 | LON | LAT | b'1' |
|
|
25
|
+
Then MESSAGE_TO_BYTES == MESSAGE_BYTES
|
|
26
|
+
|
|
27
|
+
# Encode in NMEA
|
|
28
|
+
When NMEA_SENTENCES = encode AIS raw payload MESSAGE_BYTES to NMEA
|
|
29
|
+
| talker_id | radio_channel | seq_id | group_id |
|
|
30
|
+
| 'AIVDM' | 'A' | 0 | 0 |
|
|
31
|
+
Then ${len(NMEA_SENTENCES)} == 1
|
|
32
|
+
|
|
33
|
+
# Verify some NMEA fields
|
|
34
|
+
Given STRING_NMEA_MSG = split NMEA AIS message NMEA_SENTENCES[0] to fields
|
|
35
|
+
Then STRING_NMEA_MSG[-3] == 'A'
|
|
36
|
+
|
|
37
|
+
# Decode NMEA message
|
|
38
|
+
Given DECODED_NMEA_MESSAGE = decode NMEA AIS message NMEA_SENTENCES as dictionnary
|
|
39
|
+
When DECODED_NMEA_MESSAGE_TABLE = convert dictionary DECODED_NMEA_MESSAGE to table with keys as columns
|
|
40
|
+
Then table DECODED_NMEA_MESSAGE_TABLE is
|
|
41
|
+
| data | lat | lon | mmsi | msg_type | repeat |
|
|
42
|
+
| b'1' | LAT | LON | 235006280 | 17 | 1 |
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
@ais
|
|
2
|
+
@type_18
|
|
3
|
+
Feature: Message type 18 : Standard Class B Position Report
|
|
4
|
+
|
|
5
|
+
Scenario: Create, convert, encode and decode message
|
|
6
|
+
# Create message
|
|
7
|
+
When MESSAGE = new AIS message of type 'T18_STANDARD_CLASS_B_POSITION_REPORT'
|
|
8
|
+
| repeat | mmsi | reserved_1 | speed | accuracy | lon | lat | course | heading | second | reserved_2 | cs | display | dsc | band | msg22 | raim | radio | assigned |
|
|
9
|
+
| 1 | 235006280 | 1 | 20.2 | True | 44.3 | 22.7 | 67 | 1 | 2 | 1 | True | True | True | True | True | True | 11 | True |
|
|
10
|
+
|
|
11
|
+
# Verify bytes conversion
|
|
12
|
+
When MESSAGE_TO_BYTES = convert AIS message MESSAGE to bytes
|
|
13
|
+
When MESSAGE_BYTES = new AIS message of type 'T18_STANDARD_CLASS_B_POSITION_REPORT' as bitarray bytes
|
|
14
|
+
| repeat | mmsi | reserved_1 | speed | accuracy | lon | lat | course | heading | second | reserved_2 | cs | display | dsc | band | msg22 | raim | radio | assigned |
|
|
15
|
+
| 1 | 235006280 | 1 | 20.2 | True | 44.3 | 22.7 | 67 | 1 | 2 | 1 | True | True | True | True | True | True | 11 | True |
|
|
16
|
+
Then MESSAGE_TO_BYTES == MESSAGE_BYTES
|
|
17
|
+
|
|
18
|
+
# Encode in NMEA
|
|
19
|
+
When NMEA_SENTENCES = encode AIS raw payload MESSAGE_BYTES to NMEA
|
|
20
|
+
| talker_id | radio_channel | seq_id | group_id |
|
|
21
|
+
| 'AIVDM' | 'A' | 0 | 0 |
|
|
22
|
+
Then ${len(NMEA_SENTENCES)} == 1
|
|
23
|
+
|
|
24
|
+
# Verify some NMEA fields
|
|
25
|
+
Given STRING_NMEA_MSG = split NMEA AIS message NMEA_SENTENCES[0] to fields
|
|
26
|
+
Then STRING_NMEA_MSG[-3] == 'A'
|
|
27
|
+
|
|
28
|
+
# Decode NMEA message
|
|
29
|
+
Given DECODED_NMEA_MESSAGE = decode NMEA AIS message NMEA_SENTENCES as dictionnary
|
|
30
|
+
When DECODED_NMEA_MESSAGE_TABLE = convert dictionary DECODED_NMEA_MESSAGE to table with keys as columns
|
|
31
|
+
Then table DECODED_NMEA_MESSAGE_TABLE is
|
|
32
|
+
| accuracy | assigned | band | course | cs | display | dsc | heading | lat | lon | mmsi | msg22 | msg_type | radio | raim | repeat | reserved_1 | reserved_2 | second | speed |
|
|
33
|
+
| True | True | True | 67.0 | True | True | True | 1 | 22.7 | 44.3 | 235006280 | True | 18 | 11 | True | 1 | 1 | 1 | 2 | 20.2 |
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
@ais
|
|
2
|
+
@type_19
|
|
3
|
+
Feature: Message type 19 : Extended Class B Position Report
|
|
4
|
+
|
|
5
|
+
Scenario: Create, convert, encode and decode message
|
|
6
|
+
# Create message
|
|
7
|
+
When MESSAGE = new AIS message of type 'T19_EXTENDED_CLASS_B_POSITION_REPORT'
|
|
8
|
+
| repeat | mmsi | reserved_1 | speed | accuracy | lon | lat | course | heading | second | reserved_2 | shipname | ship_type | to_bow | to_stern | to_port | to_starboard | epfd | raim | dte | assigned |
|
|
9
|
+
| 1 | 235006280 | 1 | 62.7 | True | 44.3 | 22.7 | 267.7 | 1 | 2 | 3 | 'WOOHP' | 1 | 1 | 1 | 2 | 4 | 2 | True | True | True |
|
|
10
|
+
|
|
11
|
+
# Verify bytes conversion
|
|
12
|
+
When MESSAGE_TO_BYTES = convert AIS message MESSAGE to bytes
|
|
13
|
+
When MESSAGE_BYTES = new AIS message of type 'T19_EXTENDED_CLASS_B_POSITION_REPORT' as bitarray bytes
|
|
14
|
+
| repeat | mmsi | reserved_1 | speed | accuracy | lon | lat | course | heading | second | reserved_2 | shipname | ship_type | to_bow | to_stern | to_port | to_starboard | epfd | raim | dte | assigned |
|
|
15
|
+
| 1 | 235006280 | 1 | 62.7 | True | 44.3 | 22.7 | 267.7 | 1 | 2 | 3 | 'WOOHP' | 1 | 1 | 1 | 2 | 4 | 2 | True | True | True |
|
|
16
|
+
Then MESSAGE_TO_BYTES == MESSAGE_BYTES
|
|
17
|
+
|
|
18
|
+
# Encode in NMEA
|
|
19
|
+
When NMEA_SENTENCES = encode AIS raw payload MESSAGE_BYTES to NMEA
|
|
20
|
+
| talker_id | radio_channel | seq_id | group_id |
|
|
21
|
+
| 'AIVDM' | 'A' | 0 | 0 |
|
|
22
|
+
Then ${len(NMEA_SENTENCES)} == 1
|
|
23
|
+
|
|
24
|
+
# Verify some NMEA fields
|
|
25
|
+
Given STRING_NMEA_MSG = split NMEA AIS message NMEA_SENTENCES[0] to fields
|
|
26
|
+
Then STRING_NMEA_MSG[-3] == 'A'
|
|
27
|
+
|
|
28
|
+
# Decode NMEA message
|
|
29
|
+
Given DECODED_NMEA_MESSAGE = decode NMEA AIS message NMEA_SENTENCES as dictionnary
|
|
30
|
+
When DECODED_NMEA_MESSAGE_TABLE = convert dictionary DECODED_NMEA_MESSAGE to table with keys as columns
|
|
31
|
+
Then table DECODED_NMEA_MESSAGE_TABLE is
|
|
32
|
+
| accuracy | assigned | course | dte | epfd | heading | lat | lon | mmsi | msg_type | raim | repeat | reserved_1 | reserved_2 | second | ship_type | shipname | speed | to_bow | to_port | to_starboard | to_stern |
|
|
33
|
+
| True | True | 267.7 | True | N/A | 1 | 22.7 | 44.3 | 235006280 | 19 | True | 1 | 1 | 3 | 2 | N/A | 'WOOHP' | 62.7 | 1 | 2 | 4 | 1 |
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
@ais
|
|
2
|
+
@type_1
|
|
3
|
+
@type_2
|
|
4
|
+
@type_3
|
|
5
|
+
Feature: Message types 1, 2 and 3 : position report
|
|
6
|
+
|
|
7
|
+
Scenario Outline: Create, convert, encode and decode message
|
|
8
|
+
# Create message
|
|
9
|
+
When MESSAGE = new AIS message of type '<message_type>'
|
|
10
|
+
| repeat | mmsi | status | turn | speed | accuracy | lon | lat | course | heading | second | maneuver | raim | radio |
|
|
11
|
+
| 1 | 235006280 | 1 | 2 | 50.4 | True | 11.2 | 13.1 | 0.0 | 1 | 1 | 1 | True | 1 |
|
|
12
|
+
|
|
13
|
+
# Verify bytes conversion
|
|
14
|
+
When MESSAGE_TO_BYTES = convert AIS message MESSAGE to bytes
|
|
15
|
+
When MESSAGE_BYTES = new AIS message of type '<message_type>' as bitarray bytes
|
|
16
|
+
| repeat | mmsi | status | turn | speed | accuracy | lon | lat | course | heading | second | maneuver | raim | radio |
|
|
17
|
+
| 1 | 235006280 | 1 | 2 | 50.4 | True | 11.2 | 13.1 | 0.0 | 1 | 1 | 1 | True | 1 |
|
|
18
|
+
Then MESSAGE_TO_BYTES == MESSAGE_BYTES
|
|
19
|
+
|
|
20
|
+
# Encode in NMEA
|
|
21
|
+
When NMEA_SENTENCES = encode AIS raw payload MESSAGE_BYTES to NMEA
|
|
22
|
+
| talker_id | radio_channel | seq_id | group_id |
|
|
23
|
+
| 'AIVDM' | <channel> | 0 | 0 |
|
|
24
|
+
Then ${len(NMEA_SENTENCES)} == 1
|
|
25
|
+
|
|
26
|
+
# Verify some NMEA fields
|
|
27
|
+
Given STRING_NMEA_MSG = split NMEA AIS message NMEA_SENTENCES[0] to fields
|
|
28
|
+
Then STRING_NMEA_MSG[-3] == <channel>
|
|
29
|
+
|
|
30
|
+
# Decode NMEA message
|
|
31
|
+
Given DECODED_NMEA_MESSAGE = decode NMEA AIS message NMEA_SENTENCES as dictionnary
|
|
32
|
+
When DECODED_NMEA_MESSAGE_TABLE = convert dictionary DECODED_NMEA_MESSAGE to table with keys as columns
|
|
33
|
+
Then table DECODED_NMEA_MESSAGE_TABLE is
|
|
34
|
+
| accuracy | course | heading | lat | lon | maneuver | mmsi | msg_type | radio | raim | repeat | second | speed | status | turn |
|
|
35
|
+
| True | 0.0 | 1 | 13.1 | 11.2 | N/A | 235006280 | <type> | 1 | True | 1 | 1 | 50.4 | N/A | 2 |
|
|
36
|
+
|
|
37
|
+
Examples: With types 1, 2 and 3
|
|
38
|
+
| message_type | type | channel |
|
|
39
|
+
| T1_POSITION_REPORT | 1 | 'A' |
|
|
40
|
+
| T2_POSITION_REPORT | 2 | 'A' |
|
|
41
|
+
| T3_POSITION_REPORT | 3 | 'A' |
|
|
42
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
@ais
|
|
2
|
+
@type_20
|
|
3
|
+
Feature: Message type 20 : Data Link Management
|
|
4
|
+
|
|
5
|
+
Scenario: Create, convert, encode and decode message
|
|
6
|
+
# Create message
|
|
7
|
+
When MESSAGE = new AIS message of type 'T20_DATA_LINK_MANAGEMENT'
|
|
8
|
+
| repeat | mmsi | offset1 | number1 | timeout1 | increment1 | offset2 | number2 | timeout2 | increment2 | offset3 | number3 | timeout3 | increment3 | offset4 | number4 | timeout4 | increment4 |
|
|
9
|
+
| 1 | 235006280 | 1000 | 5 | 1 | 2047 | 2000 | 10 | 5 | 2000 | 3000 | 15 | 7 | 1000 | 4000 | 15 | 7 | 500 |
|
|
10
|
+
|
|
11
|
+
# Verify bytes conversion
|
|
12
|
+
When MESSAGE_TO_BYTES = convert AIS message MESSAGE to bytes
|
|
13
|
+
When MESSAGE_BYTES = new AIS message of type 'T20_DATA_LINK_MANAGEMENT' as bitarray bytes
|
|
14
|
+
| repeat | mmsi | offset1 | number1 | timeout1 | increment1 | offset2 | number2 | timeout2 | increment2 | offset3 | number3 | timeout3 | increment3 | offset4 | number4 | timeout4 | increment4 |
|
|
15
|
+
| 1 | 235006280 | 1000 | 5 | 1 | 2047 | 2000 | 10 | 5 | 2000 | 3000 | 15 | 7 | 1000 | 4000 | 15 | 7 | 500 |
|
|
16
|
+
Then MESSAGE_TO_BYTES == MESSAGE_BYTES
|
|
17
|
+
|
|
18
|
+
# Encode in NMEA
|
|
19
|
+
When NMEA_SENTENCES = encode AIS raw payload MESSAGE_BYTES to NMEA
|
|
20
|
+
| talker_id | radio_channel | seq_id | group_id |
|
|
21
|
+
| 'AIVDM' | 'A' | 0 | 0 |
|
|
22
|
+
Then ${len(NMEA_SENTENCES)} == 1
|
|
23
|
+
|
|
24
|
+
# Verify some NMEA fields
|
|
25
|
+
Given STRING_NMEA_MSG = split NMEA AIS message NMEA_SENTENCES[0] to fields
|
|
26
|
+
Then STRING_NMEA_MSG[-3] == 'A'
|
|
27
|
+
|
|
28
|
+
# Decode NMEA message
|
|
29
|
+
Given DECODED_NMEA_MESSAGE = decode NMEA AIS message NMEA_SENTENCES as dictionnary
|
|
30
|
+
When DECODED_NMEA_MESSAGE_TABLE = convert dictionary DECODED_NMEA_MESSAGE to table with keys as columns
|
|
31
|
+
Then table DECODED_NMEA_MESSAGE_TABLE is
|
|
32
|
+
| increment1 | increment2 | increment3 | increment4 | mmsi | msg_type | number1 | number2 | number3 | number4 | offset1 | offset2 | offset3 | offset4 | repeat | timeout1 | timeout2 | timeout3 | timeout4 |
|
|
33
|
+
| 2047 | 2000 | 1000 | 500 | 235006280 | 20 | 5 | 10 | 15 | 15 | 1000 | 2000 | 3000 | 4000 | 1 | 1 | 5 | 7 | 7 |
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
@ais
|
|
2
|
+
@type_21
|
|
3
|
+
Feature: Message type 21 : Aids To Navigation Report
|
|
4
|
+
|
|
5
|
+
Scenario: Create, convert, encode and decode message
|
|
6
|
+
# Create message
|
|
7
|
+
When MESSAGE = new AIS message of type 'T21_AIDS_TO_NAVIGATION_REPORT'
|
|
8
|
+
| repeat | mmsi | name | accuracy | lon | lat | to_bow | to_stern | to_port | to_starboard | epfd | second | off_position | reserved_1 | raim | virtual_aid | assigned | name_ext |
|
|
9
|
+
| 1 | 0235006280 | 'TYPE 21' | True | 11.2 | 13.1 | 1 | 1 | 1 | 1 | 1 | 1 | True | 7 | True | True | True | 'AIS 21' |
|
|
10
|
+
|
|
11
|
+
# Verify bytes conversion
|
|
12
|
+
When MESSAGE_TO_BYTES = convert AIS message MESSAGE to bytes
|
|
13
|
+
When MESSAGE_BYTES = new AIS message of type 'T21_AIDS_TO_NAVIGATION_REPORT' as bitarray bytes
|
|
14
|
+
| repeat | mmsi | name | accuracy | lon | lat | to_bow | to_stern | to_port | to_starboard | epfd | second | off_position | reserved_1 | raim | virtual_aid | assigned | name_ext |
|
|
15
|
+
| 1 | 0235006280 | 'TYPE 21' | True | 11.2 | 13.1 | 1 | 1 | 1 | 1 | 1 | 1 | True | 7 | True | True | True | 'AIS 21' |
|
|
16
|
+
Then MESSAGE_TO_BYTES == MESSAGE_BYTES
|
|
17
|
+
|
|
18
|
+
# Encode in NMEA
|
|
19
|
+
When NMEA_SENTENCES = encode AIS raw payload MESSAGE_BYTES to NMEA
|
|
20
|
+
| talker_id | radio_channel | seq_id | group_id |
|
|
21
|
+
| 'AIVDM' | 'A' | 0 | 0 |
|
|
22
|
+
Then ${len(NMEA_SENTENCES)} == 1
|
|
23
|
+
|
|
24
|
+
# Verify some NMEA fields
|
|
25
|
+
Given STRING_NMEA_MSG = split NMEA AIS message NMEA_SENTENCES[0] to fields
|
|
26
|
+
Then STRING_NMEA_MSG[-3] == 'A'
|
|
27
|
+
|
|
28
|
+
# Decode NMEA message
|
|
29
|
+
Given DECODED_NMEA_MESSAGE = decode NMEA AIS message NMEA_SENTENCES as dictionnary
|
|
30
|
+
When DECODED_NMEA_MESSAGE_TABLE = convert dictionary DECODED_NMEA_MESSAGE to table with keys as columns
|
|
31
|
+
Then table DECODED_NMEA_MESSAGE_TABLE is
|
|
32
|
+
| accuracy | aid_type | assigned | epfd | lat | lon | mmsi | msg_type | name | name_ext | off_position | raim | repeat | reserved_1 | second | to_bow | to_port | to_starboard | to_stern | virtual_aid |
|
|
33
|
+
| True | N/A | True | N/A | 13.1 | 11.2 | 235006280 | 21 | 'TYPE 21' | 'AIS 21' | True | True | 1 | 7 | 1 | 1 | 1 | 1 | 1 | True |
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
@ais
|
|
2
|
+
@type_22
|
|
3
|
+
Feature: Message type 22 : Channel Management Addressed & Broadcast
|
|
4
|
+
|
|
5
|
+
@addressed
|
|
6
|
+
Scenario: Create, convert, encode and decode message for Channel A
|
|
7
|
+
# Create message
|
|
8
|
+
When MESSAGE = new AIS message of type 'T22_CHANNEL_MANAGEMENT'
|
|
9
|
+
| repeat | mmsi | channel_a | channel_b | txrx | power | addressed | dest1 | empty_1 | dest2 | empty_2 | zonesize |
|
|
10
|
+
| 1 | 235006280 | True | False | True | 1 | 1 | 235006281 | 1 | 235006282 | 2 | 1 |
|
|
11
|
+
|
|
12
|
+
# Verify bytes conversion
|
|
13
|
+
When MESSAGE_TO_BYTES = convert AIS message MESSAGE to bytes
|
|
14
|
+
When MESSAGE_BYTES = new AIS message of type 'T22_CHANNEL_MANAGEMENT' as bitarray bytes
|
|
15
|
+
| repeat | mmsi | channel_a | channel_b | txrx | power | addressed | dest1 | empty_1 | dest2 | empty_2 | zonesize |
|
|
16
|
+
| 1 | 235006280 | True | False | True | 1 | 1 | 235006281 | 1 | 235006282 | 2 | 1 |
|
|
17
|
+
Then MESSAGE_TO_BYTES == MESSAGE_BYTES
|
|
18
|
+
|
|
19
|
+
# Encode in NMEA
|
|
20
|
+
When NMEA_SENTENCES = encode AIS raw payload MESSAGE_BYTES to NMEA
|
|
21
|
+
| talker_id | radio_channel | seq_id | group_id |
|
|
22
|
+
| 'AIVDM' | 'A' | 0 | 0 |
|
|
23
|
+
Then ${len(NMEA_SENTENCES)} == 1
|
|
24
|
+
|
|
25
|
+
# Verify some NMEA fields
|
|
26
|
+
Given STRING_NMEA_MSG = split NMEA AIS message NMEA_SENTENCES[0] to fields
|
|
27
|
+
Then STRING_NMEA_MSG[-3] == 'A'
|
|
28
|
+
|
|
29
|
+
# Decode NMEA message
|
|
30
|
+
Given DECODED_NMEA_MESSAGE = decode NMEA AIS message NMEA_SENTENCES as dictionnary
|
|
31
|
+
When DECODED_NMEA_MESSAGE_TABLE = convert dictionary DECODED_NMEA_MESSAGE to table with keys as columns
|
|
32
|
+
Then table DECODED_NMEA_MESSAGE_TABLE is
|
|
33
|
+
| addressed | band_a | band_b | channel_a | channel_b | dest1 | dest2 | empty_1 | empty_2 | mmsi | msg_type | power | repeat | txrx | zonesize |
|
|
34
|
+
| True | False | False | 1 | 0 | 235006281 | 235006282 | 1 | 2 | 235006280 | 22 | True | 1 | 1 | 1 |
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
@broadcast
|
|
40
|
+
Scenario: Create, convert, encode and decode message for Channel B
|
|
41
|
+
### PRECONDITIONS - BEGIN
|
|
42
|
+
Given begin preconditions
|
|
43
|
+
|
|
44
|
+
Given NE_LON = 33.2
|
|
45
|
+
Given NE_LAT = 6.2
|
|
46
|
+
|
|
47
|
+
Given SW_LON = 15.7
|
|
48
|
+
Given SW_LAT = 1.1
|
|
49
|
+
|
|
50
|
+
Given end preconditions
|
|
51
|
+
### PRECONDITIONS - END
|
|
52
|
+
|
|
53
|
+
# Create message
|
|
54
|
+
When MESSAGE = new AIS message of type 'T22_CHANNEL_MANAGEMENT'
|
|
55
|
+
| repeat | mmsi | channel_a | channel_b | txrx | power | addressed | dest1 | empty_1 | dest2 | empty_2 | zonesize | ne_lon | ne_lat | sw_lon | sw_lat |
|
|
56
|
+
| 1 | 235006280 | False | True | False | 1 | 0 | 11 | 1 | 22 | 2 | 0 | NE_LON | NE_LAT | SW_LON | SW_LAT |
|
|
57
|
+
|
|
58
|
+
# Verify bytes conversion
|
|
59
|
+
When MESSAGE_TO_BYTES = convert AIS message MESSAGE to bytes
|
|
60
|
+
When MESSAGE_BYTES = new AIS message of type 'T22_CHANNEL_MANAGEMENT' as bitarray bytes
|
|
61
|
+
| repeat | mmsi | channel_a | channel_b | txrx | power | addressed | dest1 | empty_1 | dest2 | empty_2 | zonesize | ne_lon | ne_lat | sw_lon | sw_lat |
|
|
62
|
+
| 1 | 235006280 | False | True | False | 1 | 0 | 11 | 1 | 22 | 2 | 0 | NE_LON | NE_LAT | SW_LON | SW_LAT |
|
|
63
|
+
Then MESSAGE_TO_BYTES == MESSAGE_BYTES
|
|
64
|
+
|
|
65
|
+
# Encode in NMEA
|
|
66
|
+
When NMEA_SENTENCES = encode AIS raw payload MESSAGE_BYTES to NMEA
|
|
67
|
+
| talker_id | radio_channel | seq_id | group_id |
|
|
68
|
+
| 'AIVDM' | 'B' | 0 | 0 |
|
|
69
|
+
Then ${len(NMEA_SENTENCES)} == 1
|
|
70
|
+
|
|
71
|
+
# Verify some NMEA fields
|
|
72
|
+
Given STRING_NMEA_MSG = split NMEA AIS message NMEA_SENTENCES[0] to fields
|
|
73
|
+
Then STRING_NMEA_MSG[-3] == 'B'
|
|
74
|
+
|
|
75
|
+
# Decode NMEA message
|
|
76
|
+
Given DECODED_NMEA_MESSAGE = decode NMEA AIS message NMEA_SENTENCES as dictionnary
|
|
77
|
+
When DECODED_NMEA_MESSAGE_TABLE = convert dictionary DECODED_NMEA_MESSAGE to table with keys as columns
|
|
78
|
+
Then table DECODED_NMEA_MESSAGE_TABLE is
|
|
79
|
+
| addressed | band_a | band_b | channel_a | channel_b | mmsi | msg_type | ne_lat | ne_lon | power | repeat | sw_lat | sw_lon | txrx | zonesize |
|
|
80
|
+
| False | False | False | 0 | 1 | 235006280 | 22 | NE_LAT | NE_LON | True | 1 | SW_LAT | SW_LON | 0 | 0 |
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@ais
|
|
2
|
+
@type_23
|
|
3
|
+
Feature: Message type 23 : Group Assignment Command
|
|
4
|
+
|
|
5
|
+
Scenario: Create, convert, encode and decode message for Channel A
|
|
6
|
+
### PRECONDITIONS - BEGIN
|
|
7
|
+
Given begin preconditions
|
|
8
|
+
|
|
9
|
+
Given NE_LON = 11.5
|
|
10
|
+
Given NE_LAT = 9.3
|
|
11
|
+
|
|
12
|
+
Given SW_LON = 22.7
|
|
13
|
+
Given SW_LAT = 18.0
|
|
14
|
+
|
|
15
|
+
Given end preconditions
|
|
16
|
+
### PRECONDITIONS - END
|
|
17
|
+
|
|
18
|
+
# Create message
|
|
19
|
+
When MESSAGE = new AIS message of type 'T23_GROUP_ASSIGNMENT_COMMAND'
|
|
20
|
+
| repeat | mmsi | ne_lon | ne_lat | sw_lon | sw_lat | station_type | ship_type | txrx | interval | quiet |
|
|
21
|
+
| 1 | 235006280 | NE_LON | NE_LAT | SW_LON | SW_LAT | 2 | 1 | 1 | 1 | 15 |
|
|
22
|
+
|
|
23
|
+
# Verify bytes conversion
|
|
24
|
+
When MESSAGE_TO_BYTES = convert AIS message MESSAGE to bytes
|
|
25
|
+
When MESSAGE_BYTES = new AIS message of type 'T23_GROUP_ASSIGNMENT_COMMAND' as bitarray bytes
|
|
26
|
+
| repeat | mmsi | ne_lon | ne_lat | sw_lon | sw_lat | station_type | ship_type | txrx | interval | quiet |
|
|
27
|
+
| 1 | 235006280 | NE_LON | NE_LAT | SW_LON | SW_LAT | 2 | 1 | 1 | 1 | 15 |
|
|
28
|
+
Then MESSAGE_TO_BYTES == MESSAGE_BYTES
|
|
29
|
+
|
|
30
|
+
# Encode in NMEA
|
|
31
|
+
When NMEA_SENTENCES = encode AIS raw payload MESSAGE_BYTES to NMEA
|
|
32
|
+
| talker_id | radio_channel | seq_id | group_id |
|
|
33
|
+
| 'AIVDM' | 'A' | 0 | 0 |
|
|
34
|
+
Then ${len(NMEA_SENTENCES)} == 1
|
|
35
|
+
|
|
36
|
+
# Verify some NMEA fields
|
|
37
|
+
Given STRING_NMEA_MSG = split NMEA AIS message NMEA_SENTENCES[0] to fields
|
|
38
|
+
Then STRING_NMEA_MSG[-3] == 'A'
|
|
39
|
+
|
|
40
|
+
# Decode NMEA message
|
|
41
|
+
Given DECODED_NMEA_MESSAGE = decode NMEA AIS message NMEA_SENTENCES as dictionnary
|
|
42
|
+
When DECODED_NMEA_MESSAGE_TABLE = convert dictionary DECODED_NMEA_MESSAGE to table with keys as columns
|
|
43
|
+
Then table DECODED_NMEA_MESSAGE_TABLE is
|
|
44
|
+
| interval | mmsi | msg_type | ne_lat | ne_lon | quiet | repeat | ship_type | station_type | sw_lat | sw_lon | txrx |
|
|
45
|
+
| N/A | 235006280 | 23 | NE_LAT | NE_LON | 15 | 1 | N/A | N/A | SW_LAT | SW_LON | N/A |
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|