From 88f1e2b96fcfe390d67c8703c583577b86fc8aad Mon Sep 17 00:00:00 2001 From: JuHyun Kim Date: Wed, 22 Aug 2012 13:46:00 +0900 Subject: [PATCH] upload to RSA --- debian/changelog | 15 ----- debian/compat | 1 - debian/control | 28 --------- debian/dirs | 2 - debian/docs | 1 - debian/libsf-common-0.install.in | 1 - debian/libsf-common-0.postinst.in | 10 --- debian/libsf-common-dev.install.in | 3 - debian/rules | 122 ------------------------------------- include/ccatalog.h | 1 - include/sf_common.h | 21 ++++--- packaging/libsf-common.spec | 9 +-- src/ccatalog.cpp | 28 +-------- src/csock.cpp | 7 ++- 14 files changed, 21 insertions(+), 228 deletions(-) delete mode 100644 debian/changelog delete mode 100644 debian/compat delete mode 100644 debian/control delete mode 100644 debian/dirs delete mode 100644 debian/docs delete mode 100644 debian/libsf-common-0.install.in delete mode 100644 debian/libsf-common-0.postinst.in delete mode 100644 debian/libsf-common-dev.install.in delete mode 100755 debian/rules diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 5dba6da..0000000 --- a/debian/changelog +++ /dev/null @@ -1,15 +0,0 @@ -libsf-common (0.3.6-26) unstable; urgency=low - - * version sync - * Git:165.213.180.114:/pkgs/l/libsf-common - * Tag:libsf-common_0.3.6-26 - - -- JuHyun Thu, 15 Dec 2011 10:51:58 +0900 - -libsf-common (0.0.1-1) unstable; urgency=low - - * Initial Release. - * Git:165.213.180.114:/pkgs/l/libsf-common - * Tag:libsf-common_0.0.1-1 - - -- JuHyun Kim Wed, 07 Dec 2011 14:20:52 +0900 diff --git a/debian/compat b/debian/compat deleted file mode 100644 index 7ed6ff8..0000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -5 diff --git a/debian/control b/debian/control deleted file mode 100644 index ffa2d96..0000000 --- a/debian/control +++ /dev/null @@ -1,28 +0,0 @@ -Source: libsf-common -Section: libs -Priority: extra -Maintainer: Jonghoon Han , JuHyun Kim , Taesoo Jun -Build-Depends: debhelper (>= 5), autotools-dev , dlog-dev, libattr1-dev -Standards-Version: 0.0.1 -Homepage: N/A - -Package: libsf-common-dev -XB-Public-Package: no -Section: libs -Architecture: any -Depends: libsf-common-0 (= ${Source-Version}) -Description: Sensor framework common library - -Package: libsf-common-0 -Section: libs -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Sensor framework common library - Common library, only used for the sensor framework server & client - -Package: libsf-common-dbg -Section: debug -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, libsf-common-0(= ${Source-Version}) -Description:Sensor framework common library(unstripped) - Easy Sensor framework common library for SLP(not recommended) diff --git a/debian/dirs b/debian/dirs deleted file mode 100644 index ca882bb..0000000 --- a/debian/dirs +++ /dev/null @@ -1,2 +0,0 @@ -usr/bin -usr/sbin diff --git a/debian/docs b/debian/docs deleted file mode 100644 index a0f0008..0000000 --- a/debian/docs +++ /dev/null @@ -1 +0,0 @@ -CMakeLists.txt diff --git a/debian/libsf-common-0.install.in b/debian/libsf-common-0.install.in deleted file mode 100644 index bf766f0..0000000 --- a/debian/libsf-common-0.install.in +++ /dev/null @@ -1 +0,0 @@ -@PREFIX@/lib/*.so* diff --git a/debian/libsf-common-0.postinst.in b/debian/libsf-common-0.postinst.in deleted file mode 100644 index 9a46c70..0000000 --- a/debian/libsf-common-0.postinst.in +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -#if [ ${USER} == "root" ];then - # change file owner - # 1.libraries - #chown root:root /usr/lib/libsf_common.so -#fi -# change file permissions -# 1.libraries -#chmod 644 /usr/lib/libsf_common.so - diff --git a/debian/libsf-common-dev.install.in b/debian/libsf-common-dev.install.in deleted file mode 100644 index 2a4ce74..0000000 --- a/debian/libsf-common-dev.install.in +++ /dev/null @@ -1,3 +0,0 @@ -@PREFIX@/include/* -@PREFIX@/lib/pkgconfig/*.pc - diff --git a/debian/rules b/debian/rules deleted file mode 100755 index 4a73e7b..0000000 --- a/debian/rules +++ /dev/null @@ -1,122 +0,0 @@ -#!/usr/bin/make -f -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -CFLAGS ?= -Wall -g -CXXFLAGS ?= -Wall -g -LDFLAGS ?= -PREFIX ?= /usr -DATADIR ?= /opt - -ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) - CFLAGS += -O0 - CXXFLAGS += -O0 -else - CFLAGS += -O2 - CXXFLAGS += -O2 -std=c++0x -endif - -LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed - -configure: configure-stamp -configure-stamp: - dh_testdir - # Add here commands to configure the package. - CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" cmake . -DCMAKE_INSTALL_PREFIX=$(PREFIX) - - touch configure-stamp - -build: build-stamp - -build-stamp: configure-stamp - dh_testdir - dh_buildinfo generate cat - - # Add here commands to compile the package. - $(MAKE) - #docbook-to-man debian/wavplayer.sgml > wavplayer.1 - - for f in `find $(CURDIR)/debian/ -name "*.in"`; do \ - cat $$f > $${f%.in}; \ - sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \ - sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \ - done - - - touch $@ - -clean: - dh_testdir - dh_testroot - rm -f build-stamp configure-stamp - - # Add here commands to clean up after the build process. - -$(MAKE) clean - rm -rf CMakeCache.txt - rm -rf CMakeFiles - rm -rf cmake_install.cmake - rm -rf Makefile - rm -rf install_manifest.txt - rm -rf *.so - - for f in `find $(CURDIR)/debian/ -name "*.in"`; do \ - rm -f $${f%.in}; \ - done - - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - - # Add here commands to install the package into debian/wavplayer. - $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install - - -# Build architecture-independent files here. -binary-indep: build install -# We have nothing to do by default. - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir - dh_testroot - dh_installchangelogs - dh_installdocs - dh_buildinfo install - dh_installexamples - dh_install --sourcedir=debian/tmp -# dh_installmenu -# dh_installdebconf -# dh_installlogrotate -# dh_installemacsen -# dh_installpam -# dh_installmime -# dh_python -# dh_installinit -# dh_installcron -# dh_installinfo - dh_installman - dh_link - dh_strip --dbg-package=libsf-common-dbg - dh_compress - dh_fixperms -# dh_perl - dh_makeshlibs - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/include/ccatalog.h b/include/ccatalog.h index 15ac885..3c6c95c 100755 --- a/include/ccatalog.h +++ b/include/ccatalog.h @@ -44,7 +44,6 @@ public: char *value(char *group, char *name); char *value(char *group, char *name, int idx); - char *value(char *group, char *name, void *handle); int count_of_values(char *group, char *name); void *iterate_init(void); diff --git a/include/sf_common.h b/include/sf_common.h index 9f4540f..228514c 100755 --- a/include/sf_common.h +++ b/include/sf_common.h @@ -29,7 +29,7 @@ #include #include -#define DEFAULT_SENSOR_KEY_PREFIX "memory/sensor/" +#define DEFAULT_SENSOR_KEY_PREFIX "memory/private/sensor/" #define MAX_KEY_LEN 30 #define MAX_DATA_STREAM_SIZE (sizeof(cmd_get_struct_t) + sizeof(base_data_struct) + 8) /*always check this size when a new cmd_type struct added*/ #define MAX_VALUE_SIZE 12 @@ -61,21 +61,25 @@ enum data_unit_idx_t { IDX_UNIT_LEVEL_1_TO_10, IDX_UNIT_STATE_ON_OFF, IDX_UNIT_DEGREE_PER_SECOND, + IDX_UNIT_HECTOPASCAL, + IDX_UNIT_CELSIUS, + IDX_UNIT_METER, IDX_UNIT_VENDOR_UNIT = 100, IDX_UNIT_FILTER_CONVERTED, }; enum sensor_id_t{ - ID_UNKNOWN = 0x0000, - ID_ACCEL = 0x0001, - ID_GEOMAG = 0x0002, - ID_LUMINANT = 0x0004, - ID_PROXI = 0x0008, - ID_THERMER = 0x0010, + ID_UNKNOWN = 0x0000, + ID_ACCEL = 0x0001, + ID_GEOMAG = 0x0002, + ID_LUMINANT = 0x0004, + ID_PROXI = 0x0008, + ID_THERMER = 0x0010, ID_GYROSCOPE = 0x0020, - ID_PRESSURE = 0x0040, + ID_PRESSURE = 0x0040, ID_MOTION_ENGINE = 0x0080, + ID_FUSION = 0x0100, }; enum packet_type_t { @@ -102,6 +106,7 @@ enum reg_type_t { REG_ADD = 0x01, REG_DEL = 0x02, REG_CHK = 0x03, + REG_CHG = 0x04, }; diff --git a/packaging/libsf-common.spec b/packaging/libsf-common.spec index c87f713..ea39404 100644 --- a/packaging/libsf-common.spec +++ b/packaging/libsf-common.spec @@ -1,11 +1,11 @@ +#sbs-git:slp/pkgs/l/libsf-common libsf-common 0.3.6 07588b34636f76e6457efb6d65e9318513c5957c Name: libsf-common Summary: Commonly used code and defintions for the sensor framework -Version: 0.3.6 +Version: 0.3.8 Release: 1 Group: TO_BE/FILLED_IN -License: Apache-2.0 +License: TO BE FILLED IN Source0: libsf-common-%{version}.tar.gz -Source1001: packaging/libsf-common.manifest BuildRequires: cmake, libattr-devel BuildRequires: pkgconfig(dlog) @@ -30,7 +30,6 @@ Sensor framework common library %build -cp %{SOURCE1001} . cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} @@ -41,11 +40,9 @@ rm -rf %{buildroot} %make_install %files -%manifest libsf-common.manifest %{_libdir}/libsf_common.so %files devel -%manifest libsf-common.manifest %{_includedir}/sf_common/*.h %{_libdir}/pkgconfig/sf_common.pc diff --git a/src/ccatalog.cpp b/src/ccatalog.cpp index 9f6d285..9821988 100755 --- a/src/ccatalog.cpp +++ b/src/ccatalog.cpp @@ -297,6 +297,7 @@ bool ccatalog::unload(void) } + char *ccatalog::value(char *group, char *name) { group_t *grp; @@ -325,33 +326,6 @@ char *ccatalog::value(char *group, char *name) return NULL; } -char *ccatalog::value(char *group, char *name, void *handle) -{ - group_t *grp = (group_t*)handle; - - while (grp) { - if (!strcmp(group, grp->name)) { - break; - } - - grp = (group_t*)grp->next(); - } - - if (grp) { - desc_t *desc; - desc = grp->head; - - while (desc) { - if (!strcmp(name, desc->name)) { - return desc->value; - } - desc = (desc_t*)desc->next(); - } - } - - return NULL; -} - char *ccatalog::value(char *group, char *name, int idx) { group_t *grp; diff --git a/src/csock.cpp b/src/csock.cpp index 8a14d89..554f3ee 100755 --- a/src/csock.cpp +++ b/src/csock.cpp @@ -428,6 +428,7 @@ bool csock::recv(void *buffer, int size) ssize_t recv_size; int total_recv_size = 0; + DBG("Recv message : data size is %d\n", size); if (m_handle < 0) { ERR("Invalid handle\n"); return false; @@ -456,8 +457,8 @@ bool csock::recv(void *buffer, int size) DBG("recvfrom %s\n", (char*)buffer); } else { do { - recv_size = read(m_handle, - (char*)buffer + total_recv_size, size - total_recv_size); + recv_size = ::recv(m_handle, (char*)buffer + total_recv_size, size - total_recv_size, MSG_NOSIGNAL); + if (recv_size <= 0) { ERR("Error recv_size check fail , recv_size : %d\n",recv_size); close(m_handle); @@ -520,7 +521,7 @@ bool csock::send(void *buffer, int size) } else if (m_mode & SOCK_TCP) { DBG("TCP send enabled\n"); - send_size = write(m_handle, buffer, size); + send_size = ::send(m_handle, buffer, size, MSG_NOSIGNAL); if (send_size <= 0) { ERR("Error send_size check fail , send_size : %d\n",send_size); close(m_handle); -- 2.7.4