summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristopher Peplin <chris.peplin@rhubarbtech.com>2014-01-07 16:54:54 -0500
committerChristopher Peplin <chris.peplin@rhubarbtech.com>2014-01-07 16:54:54 -0500
commit1525ed0325c7679d4ea42724652119aceb5a4d13 (patch)
treeee9890c303d6b959155e95dd823d843e7c41b435 /tests
parentbc15d0970d8fe8441202bb38514b6216e6639685 (diff)
Add a constant for the functional broadcast address 0x7df.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_core.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/test_core.c b/tests/test_core.c
index 51dff33f..b115c1c8 100644
--- a/tests/test_core.c
+++ b/tests/test_core.c
@@ -20,7 +20,7 @@ void response_received_handler(const DiagnosticResponse* response) {
START_TEST (test_receive_wrong_arb_id)
{
DiagnosticRequest request = {
- arbitration_id: 0x7df,
+ arbitration_id: OBD2_FUNCTIONAL_BROADCAST_ID,
mode: OBD2_MODE_POWERTRAIN_DIAGNOSTIC_REQUEST
};
DiagnosticRequestHandle handle = diagnostic_request(&SHIMS, &request,
@@ -37,7 +37,7 @@ END_TEST
START_TEST (test_send_diag_request_with_payload)
{
DiagnosticRequest request = {
- arbitration_id: 0x7df,
+ arbitration_id: OBD2_FUNCTIONAL_BROADCAST_ID,
mode: OBD2_MODE_POWERTRAIN_DIAGNOSTIC_REQUEST,
payload: {0x12, 0x34},
payload_length: 2
@@ -59,7 +59,7 @@ END_TEST
START_TEST (test_send_diag_request)
{
DiagnosticRequest request = {
- arbitration_id: 0x7df,
+ arbitration_id: OBD2_FUNCTIONAL_BROADCAST_ID,
mode: OBD2_MODE_EMISSIONS_DTC_REQUEST
};
DiagnosticRequestHandle handle = diagnostic_request(&SHIMS, &request,
@@ -89,8 +89,7 @@ END_TEST
START_TEST (test_request_pid_standard)
{
- // TODO need a constant for the 7df broadcast functional request
- uint16_t arb_id = 0x7df;
+ uint16_t arb_id = OBD2_MODE_POWERTRAIN_DIAGNOSTIC_REQUEST;
DiagnosticRequestHandle handle = diagnostic_request_pid(&SHIMS,
DIAGNOSTIC_STANDARD_PID, arb_id, 0x2, response_received_handler);
@@ -111,7 +110,7 @@ END_TEST
START_TEST (test_request_pid_enhanced)
{
- uint16_t arb_id = 0x7df;
+ uint16_t arb_id = OBD2_FUNCTIONAL_BROADCAST_ID;
DiagnosticRequestHandle handle = diagnostic_request_pid(&SHIMS,
DIAGNOSTIC_ENHANCED_PID, arb_id, 0x2, response_received_handler);
@@ -132,7 +131,7 @@ END_TEST
START_TEST (test_wrong_mode_response)
{
- uint16_t arb_id = 0x7df;
+ uint16_t arb_id = OBD2_FUNCTIONAL_BROADCAST_ID;
DiagnosticRequestHandle handle = diagnostic_request_pid(&SHIMS,
DIAGNOSTIC_ENHANCED_PID, arb_id, 0x2, response_received_handler);
@@ -151,7 +150,7 @@ END_TEST
START_TEST (test_handle_completed)
{
DiagnosticRequest request = {
- arbitration_id: 0x7df,
+ arbitration_id: OBD2_FUNCTIONAL_BROADCAST_ID,
mode: OBD2_MODE_POWERTRAIN_DIAGNOSTIC_REQUEST
};
DiagnosticRequestHandle handle = diagnostic_request(&SHIMS, &request,
@@ -185,7 +184,7 @@ END_TEST
START_TEST (test_negative_response)
{
DiagnosticRequest request = {
- arbitration_id: 0x7df,
+ arbitration_id: OBD2_FUNCTIONAL_BROADCAST_ID,
mode: OBD2_MODE_POWERTRAIN_DIAGNOSTIC_REQUEST
};
DiagnosticRequestHandle handle = diagnostic_request(&SHIMS, &request,