X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fvdpram_dump.c;h=adc8d6f3f19651ae7abe61e490a9ce0450629925;hb=7746ae5070326c96905ab2594c2548ece91c0cb9;hp=d44836ef64411632d3e0e6ddcb8ef05c6e224d0d;hpb=08b245dbe703255f255613e12d95cb033272d915;p=platform%2Fcore%2Ftelephony%2Ftel-plugin-vmodem.git diff --git a/src/vdpram_dump.c b/src/vdpram_dump.c index d44836e..adc8d6f 100644 --- a/src/vdpram_dump.c +++ b/src/vdpram_dump.c @@ -1,49 +1,79 @@ -/* - * tel-plugin-vmodem - * - * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include -#include - -#include - -#include -#include -#include - -#include "vdpram_dump.h" - -void vdpram_hex_dump(gboolean tx, gushort data_len, void *data) -{ - char *d; - - if(!data) - return; - - if (tx == TRUE) - d = "[TX]"; - else - d = "[RX]"; - - msg("\n====== Data DUMP ======\n"); - - msg(" %s\tData length: [%d] -", d, data_len); - tcore_util_hex_dump(" ", (gint)data_len, data); - - msg("\n====== Data DUMP ======\n"); -} +/* + * tel-plugin-vmodem + * + * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Junhwan An + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +#include "vdpram_dump.h" + +static void hex_dump(const char *pad, int size, const void *data) +{ + char buf[255] = {0, }; + char hex[4] = {0, }; + int i; + unsigned const char *p; + + if (size <= 0) { + msg("%sno data", pad); + return; + } + + p = (unsigned const char *)data; + + snprintf(buf, 255, "%s%04X: ", pad, 0); + for (i = 0; i