44
55
66/*
7- bool ELM327::begin(Stream &stream)
7+ bool ELM327::begin(Stream &stream, char protocol )
88
99 Description:
1010 ------------
1414 -------
1515 * Stream &stream - Pointer to Serial port connected
1616 to ELM327
17+ * char protocol - Protocol ID to specify the
18+ ELM327 to communicate with the ECU over
1719
1820 Return:
1921 -------
2022 * bool - Whether or not the ELM327 was propperly
2123 initialized
2224*/
23- bool ELM327::begin (Stream &stream)
25+ bool ELM327::begin (Stream &stream, char protocol )
2426{
2527 elm_port = &stream;
2628
@@ -29,7 +31,7 @@ bool ELM327::begin(Stream &stream)
2931 return false ;
3032
3133 // try to connect
32- if (!initializeELM ())
34+ if (!initializeELM (protocol ))
3335 return false ;
3436
3537 return true ;
@@ -39,15 +41,16 @@ bool ELM327::begin(Stream &stream)
3941
4042
4143/*
42- bool ELM327::initializeELM()
44+ bool ELM327::initializeELM(char protocol )
4345
4446 Description:
4547 ------------
4648 * Initializes ELM327
4749
4850 Inputs:
4951 -------
50- * void
52+ * char protocol - Protocol ID to specify the
53+ ELM327 to communicate with the ECU over
5154
5255 Return:
5356 -------
@@ -60,13 +63,14 @@ bool ELM327::begin(Stream &stream)
6063 * 0 - Automatic
6164 * 1 - SAE J1850 PWM (41.6 kbaud)
6265 * 2 - SAE J1850 PWM (10.4 kbaud)
63- * 4 - ISO 9141-2 (5 baud init)
64- * 5 - ISO 14230-4 KWP (5 baud init)
65- * 6 - ISO 14230-4 KWP (fast init)
66- * 7 - ISO 15765-4 CAN (11 bit ID, 500 kbaud)
67- * 8 - ISO 15765-4 CAN (29 bit ID, 500 kbaud)
68- * 9 - ISO 15765-4 CAN (11 bit ID, 250 kbaud)
69- * A - ISO 15765-4 CAN (29 bit ID, 250 kbaud)
66+ * 3 - ISO 9141-2 (5 baud init)
67+ * 4 - ISO 14230-4 KWP (5 baud init)
68+ * 5 - ISO 14230-4 KWP (fast init)
69+ * 6 - ISO 15765-4 CAN (11 bit ID, 500 kbaud)
70+ * 7 - ISO 15765-4 CAN (29 bit ID, 500 kbaud)
71+ * 8 - ISO 15765-4 CAN (11 bit ID, 250 kbaud)
72+ * 9 - ISO 15765-4 CAN (29 bit ID, 250 kbaud)
73+ * A - SAE J1939 CAN (29 bit ID, 250* kbaud)
7074 * B - User1 CAN (11* bit ID, 125* kbaud)
7175 * C - User2 CAN (11* bit ID, 50* kbaud)
7276
@@ -151,8 +155,7 @@ void ELM327::formatQueryArray(uint16_t service, uint32_t pid)
151155
152156
153157/*
154- void ELM327::upper(char string[],
155- uint8_t buflen)
158+ void ELM327::upper(char string[], uint8_t buflen)
156159
157160 Description:
158161 ------------
@@ -168,8 +171,7 @@ void ELM327::formatQueryArray(uint16_t service, uint32_t pid)
168171 -------
169172 * void
170173*/
171- void ELM327::upper (char string[],
172- uint8_t buflen)
174+ void ELM327::upper (char string[], uint8_t buflen)
173175{
174176 for (uint8_t i = 0 ; i < buflen; i++)
175177 {
0 commit comments