mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2026-03-14 21:20:28 +01:00
bbf: accept dateTime type with microsecond precision
Some parameters must be specified with microsecond precision such as: - Device.IP.Diagnostics.DownloadDiagnostics.(ROMTime, BOMTime, EOMTime, TCPOpenResponseTime, etc) - Device.IP.Diagnostics.UploadDiagnostics.(ROMTime, BOMTime, EOMTime, TCPOpenResponseTime, etc)
This commit is contained in:
parent
e3b313ef8d
commit
d27c4137f7
1 changed files with 4 additions and 3 deletions
|
|
@ -1145,6 +1145,7 @@ static char *check_value_by_type(char *value, int type)
|
|||
{
|
||||
int i = 0, len = strlen(value);
|
||||
char buf[len + 1];
|
||||
struct tm tm;
|
||||
|
||||
strcpy(buf, value);
|
||||
buf[len] = 0;
|
||||
|
|
@ -1175,7 +1176,7 @@ static char *check_value_by_type(char *value, int type)
|
|||
case DMT_HEXBIN:
|
||||
while (buf[i] != 0) {
|
||||
if (isxdigit(buf[i]) == 0)
|
||||
return "0";
|
||||
return "";
|
||||
i++;
|
||||
}
|
||||
break;
|
||||
|
|
@ -1187,8 +1188,8 @@ static char *check_value_by_type(char *value, int type)
|
|||
}
|
||||
break;
|
||||
case DMT_TIME:
|
||||
if (dm_validate_dateTime(buf))
|
||||
return "0001-01-01T00:00:00Z";
|
||||
if (!strptime(buf, (len == 27) ? "%Y-%m-%dT%H:%M:%S." : "%Y-%m-%dT%H:%M:%SZ", &tm))
|
||||
return (len == 27) ? "0001-01-01T00:00:00.000000Z" : "0001-01-01T00:00:00Z";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue