This repository has been archived on 2019-06-21. You can view files and clone it, but cannot push or open issues or pull requests.
2016-10-20 19:06:41 +00:00
|
|
|
//#include <string.h>
|
|
|
|
//#include <algorithm>
|
2016-11-17 19:36:17 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "Utilities.h"
|
|
|
|
#include "Arduino.h"
|
2016-10-20 19:06:41 +00:00
|
|
|
|
2016-10-16 14:08:43 +00:00
|
|
|
int findChar(char* str, char targetChar)
|
|
|
|
{
|
2016-10-21 20:16:15 +00:00
|
|
|
for(int i = 0; str[i] != '\0'; i++) {
|
|
|
|
if(str[i] == targetChar) return i;
|
|
|
|
}
|
2016-10-16 14:08:43 +00:00
|
|
|
}
|
|
|
|
|
2016-10-20 19:06:41 +00:00
|
|
|
/*
|
|
|
|
int getPosition(const char *array, size_t size, char c)
|
|
|
|
{
|
|
|
|
const char* end = array + size;
|
|
|
|
const char* match = std::find(array, end, c);
|
|
|
|
return (end == match)? -1 : (match-array);
|
|
|
|
}
|
|
|
|
*/
|
2016-11-17 19:36:17 +00:00
|
|
|
|
|
|
|
void Utilities::PrintCharsAsHex(char* charArray, size_t length)
|
|
|
|
{
|
|
|
|
for(int i = 0; i < length; i++)
|
|
|
|
{
|
|
|
|
Serial.print((int)(charArray[i]), HEX);
|
|
|
|
Serial.print(" ");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|