{"push_id":2934705162,"size":1,"distinct_size":1,"ref":"refs/heads/fix_and_improve_watch_voice_msg_handling","head":"5acfa99304d4d53c527c28ab61e811ac9237f261","before":"8fb1a0e585717806f1c26e2a1fd9fe20a6a62cc1","commits":[{"sha":"5acfa99304d4d53c527c28ab61e811ac9237f261","author":{"name":"The Brain","email":"f7012b7bc224e948ef90efda28309490c8cd9784@gmail.com"},"message":"fix and improve watch - voice msg cmd handling\n\n+-----------------------------------------------------------------+\nfix: \n====\n\nThe cmd was not sent before when triggered from the web frontend if\n\"real\" amr data (taken from a file generated from a smartwatch) was\nentered to the \"Key_Data\" field within the webform, for some reasons:\n\nthe call (WatchProtocolEnecoder.java::191): \ncmdtoSend = formatCommand(channel, command, \"TK,\" +\ngetBinaryData(command));\n\ndirectly concats the binay data to the cmd content, which causes (with\nreal data) a handling problem within the class\nStringProtocolEncoder::formatCommand\nThe binary blob also can contain \"\\\" and \"$\" which cause problems \nwhen a string replacement methode is called.\n\nAccording to java doc 'quoteReplacement' should be used in that cases...\n\nAlso changed the direct content concating to using the \"key -\nreplacment conecept\" all other cmds use.\n\nAlso changed the return type of the encode methode to \"bytebuf\" because\nstrings cause problems on all non-ASCII data - e.g. as the binary blob\nof an amr file.\n\nFor the same reason, also the unit test of the watchencoder has been\nchanged from string to binary assert values and the voice msg test now\ncovers non-ascii char + char which need to be escaped.\n\n\nThis changes don't affact usual text cmds (which don't contain binary\ndata) - according to my tests but make the VOICE MSG cmd usable.\n+-----------------------------------------------------------------+\nImprovement: \n============\nIntroduced a new cmd type (binary blob) for e.g. voice data.\n\nAlso added a way to specify a filename instead of forcing the user to\ncopy & paste unhandy audio data as hex encoded stream to the web form,\nbecause it should be easier to reference to a file (and read the binary\nblob from this file) than to extract this data manually.\n\nTo reference an amr - audio file, one needs to enter\n\"file://[rel.path]/[filename.amr]\" within the \"KEY_DATA\" field in the\nwebform.\nThe path of the file is relative to the one which is configured as \n\"media.path\" \n\ne.g. if media.path is set to \"/mypath\" and the audio file is\nstored in /mypath/foo/bar.amr then \"file://foo/bar.amr\" entered\nas KEY_DATA will trigger a file read.\n+-----------------------------------------------------------------+","distinct":true,"url":"https://api.github.com/repos/TheBrain8791/traccar/commits/5acfa99304d4d53c527c28ab61e811ac9237f261"}]}
{"actor":{"display_login":"TheBrain8791"}}