sync with tizen_2.2
authorsungmin82.ha <sungmin82.ha@samsung.com>
Tue, 30 Jul 2013 06:12:54 +0000 (15:12 +0900)
committersungmin82.ha <sungmin82.ha@samsung.com>
Tue, 30 Jul 2013 06:12:54 +0000 (15:12 +0900)
Change-Id: I39d336600e377253b4e88218ac74c0bd5411ddfc
Signed-off-by: Sungmin Ha <sungmin82.ha@samsung.com>
263 files changed:
AUTHORS
LICENSE.APLv2 [moved from LICENSE with 97% similarity]
NOTICE
builder/metadata/data/IDE/plugins/org.tizen.telephony.call_1.3.20.201202101837.jar [deleted file]
builder/metadata/data/IDE/plugins/org.tizen.telephony.sms_1.3.20.201202101837.jar [deleted file]
org.tizen.eventinjector.feature/feature.properties
org.tizen.eventinjector.feature/feature.xml
org.tizen.injector.device/.classpath [moved from org.tizen.nfc/.classpath with 100% similarity]
org.tizen.injector.device/.project [moved from org.tizen.location.core/.project with 93% similarity]
org.tizen.injector.device/.settings/org.eclipse.jdt.core.prefs [moved from org.tizen.nfc/.settings/org.eclipse.jdt.core.prefs with 100% similarity]
org.tizen.injector.device/META-INF/MANIFEST.MF [moved from org.tizen.device/META-INF/MANIFEST.MF with 58% similarity]
org.tizen.injector.device/build.properties [moved from org.tizen.sensor.proximity/build.properties with 100% similarity]
org.tizen.injector.device/plugin.xml [moved from org.tizen.device/plugin.xml with 52% similarity]
org.tizen.injector.device/src/org/tizen/injector/device/battery/Battery.java [moved from org.tizen.device/src/org/tizen/device/battery/Battery.java with 80% similarity]
org.tizen.injector.device/src/org/tizen/injector/device/battery/page/BatteryConstants.java [moved from org.tizen.device/src/org/tizen/device/battery/page/BatteryConstants.java with 83% similarity]
org.tizen.injector.device/src/org/tizen/injector/device/battery/page/BatteryPage.java [moved from org.tizen.device/src/org/tizen/device/battery/page/BatteryPage.java with 63% similarity]
org.tizen.injector.device/src/org/tizen/injector/device/earjack/Earjack.java [moved from org.tizen.device/src/org/tizen/device/earjack/Earjack.java with 80% similarity]
org.tizen.injector.device/src/org/tizen/injector/device/earjack/page/EarjackConstants.java [moved from org.tizen.device/src/org/tizen/device/earjack/page/EarjackConstants.java with 76% similarity]
org.tizen.injector.device/src/org/tizen/injector/device/earjack/page/EarjackPage.java [moved from org.tizen.device/src/org/tizen/device/earjack/page/EarjackPage.java with 72% similarity]
org.tizen.injector.device/src/org/tizen/injector/device/rssi/Rssi.java [moved from org.tizen.device/src/org/tizen/device/rssi/Rssi.java with 81% similarity]
org.tizen.injector.device/src/org/tizen/injector/device/rssi/page/G02A31.java [new file with mode: 0644]
org.tizen.injector.device/src/org/tizen/injector/device/rssi/page/RssiPage.java [moved from org.tizen.device/src/org/tizen/device/rssi/page/RssiPage.java with 55% similarity]
org.tizen.injector.device/src/org/tizen/injector/device/sdcard/Sdcard.java [moved from org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/Sensor.java with 75% similarity]
org.tizen.injector.device/src/org/tizen/injector/device/sdcard/page/SdcardConstants.java [new file with mode: 0644]
org.tizen.injector.device/src/org/tizen/injector/device/sdcard/page/SdcardPage.java [new file with mode: 0644]
org.tizen.injector.device/src/org/tizen/injector/device/sdcard/page/SdcardStringResource.java [moved from org.tizen.nfc/src/org/tizen/nfc/page/NfcStringResource.java with 59% similarity]
org.tizen.injector.device/src/org/tizen/injector/device/usb/Usb.java [moved from org.tizen.device/src/org/tizen/device/usb/Usb.java with 81% similarity]
org.tizen.injector.device/src/org/tizen/injector/device/usb/page/UsbConstants.java [moved from org.tizen.device/src/org/tizen/device/usb/page/UsbConstants.java with 84% similarity]
org.tizen.injector.device/src/org/tizen/injector/device/usb/page/UsbPage.java [moved from org.tizen.device/src/org/tizen/device/usb/page/UsbPage.java with 70% similarity]
org.tizen.injector.location.core/.classpath [moved from org.tizen.sensor.proximity/.classpath with 100% similarity]
org.tizen.injector.location.core/.project [new file with mode: 0644]
org.tizen.injector.location.core/.settings/org.eclipse.core.resources.prefs [moved from org.tizen.location.core/.settings/org.eclipse.core.resources.prefs with 100% similarity]
org.tizen.injector.location.core/.settings/org.eclipse.core.runtime.prefs [moved from org.tizen.location.core/.settings/org.eclipse.core.runtime.prefs with 100% similarity]
org.tizen.injector.location.core/.settings/org.eclipse.jdt.core.prefs [moved from org.tizen.location.core/.settings/org.eclipse.jdt.core.prefs with 100% similarity]
org.tizen.injector.location.core/META-INF/MANIFEST.MF [new file with mode: 0644]
org.tizen.injector.location.core/OSGI-INF/l10n/bundle.properties [moved from org.tizen.location.core/OSGI-INF/l10n/bundle.properties with 65% similarity]
org.tizen.injector.location.core/build.properties [moved from org.tizen.location.core/build.properties with 100% similarity]
org.tizen.injector.location.core/src/org/tizen/injector/location/core/injector/DebugLog.java [moved from org.tizen.location.core/src/org/tizen/location/core/injector/DebugLog.java with 86% similarity]
org.tizen.injector.location.core/src/org/tizen/injector/location/core/injector/LocationInjector.java [moved from org.tizen.location.core/src/org/tizen/location/core/injector/LocationInjector.java with 63% similarity]
org.tizen.injector.location.core/src/org/tizen/injector/location/core/model/GeoLocationVO.java [moved from org.tizen.location.core/src/org/tizen/location/core/model/GeoLocationVO.java with 89% similarity]
org.tizen.injector.location.core/src/org/tizen/injector/location/core/protocol/AbstractNMEA0183.java [moved from org.tizen.location.core/src/org/tizen/location/core/protocol/AbstractNMEA0183.java with 94% similarity]
org.tizen.injector.location.core/src/org/tizen/injector/location/core/protocol/GeoLocation.java [moved from org.tizen.location.core/src/org/tizen/location/core/protocol/GeoLocation.java with 92% similarity]
org.tizen.injector.location.core/src/org/tizen/injector/location/core/protocol/IdentifiersConstants.java [moved from org.tizen.location.core/src/org/tizen/location/core/protocol/IdentifiersConstants.java with 97% similarity]
org.tizen.injector.location.core/src/org/tizen/injector/location/core/protocol/Messages.java [moved from org.tizen.location.core/src/org/tizen/location/core/protocol/Messages.java with 81% similarity]
org.tizen.injector.location.core/src/org/tizen/injector/location/core/protocol/NMEA0183_GPGGA.java [moved from org.tizen.location.core/src/org/tizen/location/core/protocol/NMEA0183_GPGGA.java with 96% similarity]
org.tizen.injector.location.core/src/org/tizen/injector/location/core/protocol/NMEA0183_GPGSA.java [moved from org.tizen.location.core/src/org/tizen/location/core/protocol/NMEA0183_GPGSA.java with 94% similarity]
org.tizen.injector.location.core/src/org/tizen/injector/location/core/protocol/NMEA0183_GPGSV.java [moved from org.tizen.location.core/src/org/tizen/location/core/protocol/NMEA0183_GPGSV.java with 95% similarity]
org.tizen.injector.location.core/src/org/tizen/injector/location/core/protocol/NMEA0183_GPRMC.java [moved from org.tizen.location.core/src/org/tizen/location/core/protocol/NMEA0183_GPRMC.java with 96% similarity]
org.tizen.injector.location.core/src/org/tizen/injector/location/core/protocol/SatelliteInfo.java [moved from org.tizen.location.core/src/org/tizen/location/core/protocol/SatelliteInfo.java with 93% similarity]
org.tizen.injector.location.core/src/org/tizen/injector/location/core/protocol/messages.properties [moved from org.tizen.location.core/src/org/tizen/location/core/protocol/messages.properties with 100% similarity]
org.tizen.injector.location.log/.classpath [moved from org.tizen.sensor.motion/.classpath with 100% similarity]
org.tizen.injector.location.log/.project [moved from org.tizen.location.log/.project with 93% similarity]
org.tizen.injector.location.log/.settings/org.eclipse.core.resources.prefs [moved from org.tizen.location.log/.settings/org.eclipse.core.resources.prefs with 100% similarity]
org.tizen.injector.location.log/.settings/org.eclipse.core.runtime.prefs [moved from org.tizen.location.log/.settings/org.eclipse.core.runtime.prefs with 100% similarity]
org.tizen.injector.location.log/META-INF/MANIFEST.MF [moved from org.tizen.location.log/META-INF/MANIFEST.MF with 71% similarity]
org.tizen.injector.location.log/OSGI-INF/l10n/bundle.properties [new file with mode: 0644]
org.tizen.injector.location.log/build.properties [moved from org.tizen.location.map/build.properties with 96% similarity]
org.tizen.injector.location.log/plugin.xml [moved from org.tizen.location.log/plugin.xml with 71% similarity]
org.tizen.injector.location.log/src/org/tizen/injector/location/log/Log.java [moved from org.tizen.location.log/src/org/tizen/location/log/Log.java with 80% similarity]
org.tizen.injector.location.log/src/org/tizen/injector/location/log/Messages.java [moved from org.tizen.location.log/src/org/tizen/location/log/Messages.java with 82% similarity]
org.tizen.injector.location.log/src/org/tizen/injector/location/log/messages.properties [moved from org.tizen.location.log/src/org/tizen/location/log/messages.properties with 100% similarity]
org.tizen.injector.location.log/src/org/tizen/injector/location/log/page/LogFile.java [moved from org.tizen.location.log/src/org/tizen/location/log/page/LogFile.java with 94% similarity]
org.tizen.injector.location.log/src/org/tizen/injector/location/log/page/Messages.java [moved from org.tizen.location.log/src/org/tizen/location/log/page/Messages.java with 82% similarity]
org.tizen.injector.location.log/src/org/tizen/injector/location/log/page/messages.properties [moved from org.tizen.location.log/src/org/tizen/location/log/page/messages.properties with 100% similarity]
org.tizen.injector.location.manual/.classpath [moved from org.tizen.sensor.light/.classpath with 100% similarity]
org.tizen.injector.location.manual/.project [new file with mode: 0644]
org.tizen.injector.location.manual/.settings/org.eclipse.core.resources.prefs [moved from org.tizen.location.manual/.settings/org.eclipse.core.resources.prefs with 100% similarity]
org.tizen.injector.location.manual/.settings/org.eclipse.core.runtime.prefs [moved from org.tizen.location.manual/.settings/org.eclipse.core.runtime.prefs with 100% similarity]
org.tizen.injector.location.manual/META-INF/MANIFEST.MF [moved from org.tizen.location.manual/META-INF/MANIFEST.MF with 69% similarity]
org.tizen.injector.location.manual/OSGI-INF/l10n/bundle.properties [new file with mode: 0644]
org.tizen.injector.location.manual/build.properties [moved from org.tizen.location.manual/build.properties with 96% similarity]
org.tizen.injector.location.manual/plugin.xml [moved from org.tizen.location.manual/plugin.xml with 70% similarity]
org.tizen.injector.location.manual/src/org/tizen/injector/location/manual/Manual.java [moved from org.tizen.location.manual/src/org/tizen/location/manual/Manual.java with 80% similarity]
org.tizen.injector.location.manual/src/org/tizen/injector/location/manual/Messages.java [moved from org.tizen.location.manual/src/org/tizen/location/manual/Messages.java with 82% similarity]
org.tizen.injector.location.manual/src/org/tizen/injector/location/manual/messages.properties [moved from org.tizen.location.manual/src/org/tizen/location/manual/messages.properties with 100% similarity]
org.tizen.injector.location.manual/src/org/tizen/injector/location/manual/page/Coordinate.java [moved from org.tizen.location.manual/src/org/tizen/location/manual/page/Coordinate.java with 89% similarity]
org.tizen.injector.location.manual/src/org/tizen/injector/location/manual/page/Messages.java [moved from org.tizen.location.manual/src/org/tizen/location/manual/page/Messages.java with 82% similarity]
org.tizen.injector.location.manual/src/org/tizen/injector/location/manual/page/messages.properties [moved from org.tizen.location.manual/src/org/tizen/location/manual/page/messages.properties with 100% similarity]
org.tizen.injector.location.map/.classpath [moved from org.tizen.sensor.accelerometer/.classpath with 100% similarity]
org.tizen.injector.location.map/.project [moved from org.tizen.location.manual/.project with 93% similarity]
org.tizen.injector.location.map/.settings/org.eclipse.core.resources.prefs [moved from org.tizen.location.map/.settings/org.eclipse.core.resources.prefs with 100% similarity]
org.tizen.injector.location.map/.settings/org.eclipse.core.runtime.prefs [moved from org.tizen.location.map/.settings/org.eclipse.core.runtime.prefs with 100% similarity]
org.tizen.injector.location.map/META-INF/MANIFEST.MF [moved from org.tizen.location.map/META-INF/MANIFEST.MF with 74% similarity]
org.tizen.injector.location.map/OSGI-INF/l10n/bundle.properties [new file with mode: 0644]
org.tizen.injector.location.map/build.properties [moved from org.tizen.location.log/build.properties with 96% similarity]
org.tizen.injector.location.map/html/googleMap.html [moved from org.tizen.location.map/html/googleMap.html with 100% similarity]
org.tizen.injector.location.map/plugin.xml [moved from org.tizen.location.map/plugin.xml with 71% similarity]
org.tizen.injector.location.map/src/org/tizen/injector/location/map/Map.java [moved from org.tizen.location.map/src/org/tizen/location/map/Map.java with 75% similarity]
org.tizen.injector.location.map/src/org/tizen/injector/location/map/Messages.java [moved from org.tizen.location.map/src/org/tizen/location/map/Messages.java with 82% similarity]
org.tizen.injector.location.map/src/org/tizen/injector/location/map/messages.properties [moved from org.tizen.location.map/src/org/tizen/location/map/messages.properties with 100% similarity]
org.tizen.injector.location.map/src/org/tizen/injector/location/map/page/CheckNetThread.java [new file with mode: 0644]
org.tizen.injector.location.map/src/org/tizen/injector/location/map/page/DebugLog.java [new file with mode: 0644]
org.tizen.injector.location.map/src/org/tizen/injector/location/map/page/MapImage.java [moved from org.tizen.location.map/src/org/tizen/location/map/page/MapImage.java with 76% similarity]
org.tizen.injector.location.map/src/org/tizen/injector/location/map/page/Messages.java [moved from org.tizen.location.map/src/org/tizen/location/map/page/Messages.java with 84% similarity]
org.tizen.injector.location.map/src/org/tizen/injector/location/map/page/messages.properties [moved from org.tizen.location.map/src/org/tizen/location/map/page/messages.properties with 100% similarity]
org.tizen.injector.nfc/.classpath [moved from org.tizen.device/.classpath with 100% similarity]
org.tizen.injector.nfc/.project [moved from org.tizen.device/.project with 94% similarity]
org.tizen.injector.nfc/.settings/org.eclipse.jdt.core.prefs [moved from org.tizen.device/.settings/org.eclipse.jdt.core.prefs with 100% similarity]
org.tizen.injector.nfc/META-INF/MANIFEST.MF [moved from org.tizen.nfc/META-INF/MANIFEST.MF with 71% similarity]
org.tizen.injector.nfc/build.properties [moved from org.tizen.sensor.motion/build.properties with 100% similarity]
org.tizen.injector.nfc/plugin.xml [moved from org.tizen.nfc/plugin.xml with 74% similarity]
org.tizen.injector.nfc/src/org/tizen/injector/nfc/Nfc.java [moved from org.tizen.nfc/src/org/tizen/nfc/Nfc.java with 84% similarity]
org.tizen.injector.nfc/src/org/tizen/injector/nfc/page/NDEFRecord.java [moved from org.tizen.nfc/src/org/tizen/nfc/page/NDEFRecord.java with 90% similarity]
org.tizen.injector.nfc/src/org/tizen/injector/nfc/page/NDEFRecordPage.java [new file with mode: 0644]
org.tizen.injector.nfc/src/org/tizen/injector/nfc/page/NfcCommand.java [moved from org.tizen.nfc/src/org/tizen/nfc/page/NfcCommand.java with 87% similarity]
org.tizen.injector.nfc/src/org/tizen/injector/nfc/page/NfcDialog.java [moved from org.tizen.nfc/src/org/tizen/nfc/page/NfcDialog.java with 94% similarity]
org.tizen.injector.nfc/src/org/tizen/injector/nfc/page/NfcHelpProcess.java [new file with mode: 0644]
org.tizen.injector.nfc/src/org/tizen/injector/nfc/page/NfcMimeType.java [moved from org.tizen.nfc/src/org/tizen/nfc/page/NfcMimeType.java with 94% similarity]
org.tizen.injector.nfc/src/org/tizen/injector/nfc/page/NfcPage.java [new file with mode: 0644]
org.tizen.injector.nfc/src/org/tizen/injector/nfc/page/NfcStringResource.java [new file with mode: 0644]
org.tizen.injector.sensor.accelerometer/.classpath [moved from org.tizen.location.map/.classpath with 100% similarity]
org.tizen.injector.sensor.accelerometer/.project [new file with mode: 0644]
org.tizen.injector.sensor.accelerometer/.settings/org.eclipse.core.runtime.prefs [moved from org.tizen.sensor.accelerometer/.settings/org.eclipse.core.runtime.prefs with 100% similarity]
org.tizen.injector.sensor.accelerometer/.settings/org.eclipse.jdt.core.prefs [moved from org.tizen.sensor.accelerometer/.settings/org.eclipse.jdt.core.prefs with 100% similarity]
org.tizen.injector.sensor.accelerometer/META-INF/MANIFEST.MF [moved from org.tizen.sensor.accelerometer/META-INF/MANIFEST.MF with 67% similarity]
org.tizen.injector.sensor.accelerometer/build.properties [moved from org.tizen.sensor.light/build.properties with 100% similarity]
org.tizen.injector.sensor.accelerometer/plugin.xml [moved from org.tizen.sensor.accelerometer/plugin.xml with 68% similarity]
org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/accelerometer/FileListVO.java [new file with mode: 0644]
org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/accelerometer/Sensor.java [new file with mode: 0644]
org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/accelerometer/SensorConstants.java [new file with mode: 0644]
org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/accelerometer/page/Accelerometer.java [moved from org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/page/Accelerometer.java with 74% similarity]
org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/accelerometer/page/ManualInputAccel.java [new file with mode: 0644]
org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/accelerometer/page/ManualInputGyro.java [new file with mode: 0644]
org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/accelerometer/page/ManualInputMagnetic.java [new file with mode: 0644]
org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/accelerometer/page/ManualInputTilt.java [new file with mode: 0644]
org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/accelerometer/page/MobilePanel.java [moved from org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/page/MobilePanel.java with 80% similarity]
org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/accelerometer/page/Vector.java [moved from org.tizen.sensor.accelerometer/src/org/tizen/sensor/accelerometer/page/Vector.java with 99% similarity]
org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/magnetic/Magnetic.java [moved from org.tizen.sensor.accelerometer/src/org/tizen/sensor/magnetic/Magnetic.java with 86% similarity]
org.tizen.injector.sensor.light/.classpath [moved from org.tizen.location.manual/.classpath with 100% similarity]
org.tizen.injector.sensor.light/.project [new file with mode: 0644]
org.tizen.injector.sensor.light/.settings/org.eclipse.jdt.core.prefs [moved from org.tizen.sensor.light/.settings/org.eclipse.jdt.core.prefs with 100% similarity]
org.tizen.injector.sensor.light/META-INF/MANIFEST.MF [moved from org.tizen.sensor.light/META-INF/MANIFEST.MF with 75% similarity]
org.tizen.injector.sensor.light/build.properties [moved from org.tizen.sensor.accelerometer/build.properties with 100% similarity]
org.tizen.injector.sensor.light/plugin.xml [moved from org.tizen.sensor.light/plugin.xml with 71% similarity]
org.tizen.injector.sensor.light/src/org/tizen/injector/sensor/light/Light.java [moved from org.tizen.sensor.light/src/org/tizen/sensor/light/Light.java with 85% similarity]
org.tizen.injector.sensor.light/src/org/tizen/injector/sensor/light/page/LightPage.java [new file with mode: 0644]
org.tizen.injector.sensor.motion/.classpath [moved from org.tizen.location.log/.classpath with 100% similarity]
org.tizen.injector.sensor.motion/.project [new file with mode: 0644]
org.tizen.injector.sensor.motion/.settings/org.eclipse.jdt.core.prefs [moved from org.tizen.sensor.motion/.settings/org.eclipse.jdt.core.prefs with 100% similarity]
org.tizen.injector.sensor.motion/META-INF/MANIFEST.MF [moved from org.tizen.sensor.motion/META-INF/MANIFEST.MF with 74% similarity]
org.tizen.injector.sensor.motion/build.properties [moved from org.tizen.nfc/build.properties with 100% similarity]
org.tizen.injector.sensor.motion/plugin.xml [moved from org.tizen.sensor.motion/plugin.xml with 70% similarity]
org.tizen.injector.sensor.motion/src/org/tizen/injector/sensor/motion/Motion.java [moved from org.tizen.sensor.motion/src/org/tizen/sensor/motion/Motion.java with 85% similarity]
org.tizen.injector.sensor.motion/src/org/tizen/injector/sensor/motion/page/MotionPage.java [moved from org.tizen.sensor.motion/src/org/tizen/sensor/motion/page/MotionPage.java with 78% similarity]
org.tizen.injector.sensor.proximity/.classpath [moved from org.tizen.location.core/.classpath with 100% similarity]
org.tizen.injector.sensor.proximity/.project [new file with mode: 0644]
org.tizen.injector.sensor.proximity/.settings/org.eclipse.jdt.core.prefs [moved from org.tizen.sensor.proximity/.settings/org.eclipse.jdt.core.prefs with 100% similarity]
org.tizen.injector.sensor.proximity/META-INF/MANIFEST.MF [moved from org.tizen.sensor.proximity/META-INF/MANIFEST.MF with 73% similarity]
org.tizen.injector.sensor.proximity/build.properties [moved from org.tizen.device/build.properties with 100% similarity]
org.tizen.injector.sensor.proximity/plugin.xml [moved from org.tizen.sensor.proximity/plugin.xml with 69% similarity]
org.tizen.injector.sensor.proximity/src/org/tizen/injector/sensor/proximity/Proximity.java [moved from org.tizen.sensor.proximity/src/org/tizen/sensor/proximity/Proximity.java with 84% similarity]
org.tizen.injector.sensor.proximity/src/org/tizen/injector/sensor/proximity/page/ProximityConstants.java [moved from org.tizen.sensor.proximity/src/org/tizen/sensor/proximity/page/ProximityConstants.java with 80% similarity]
org.tizen.injector.sensor.proximity/src/org/tizen/injector/sensor/proximity/page/ProximityPage.java [moved from org.tizen.sensor.proximity/src/org/tizen/sensor/proximity/page/ProximityPage.java with 55% similarity]
org.tizen.injector.telephony.call/.classpath [new file with mode: 0644]
org.tizen.injector.telephony.call/.project [new file with mode: 0644]
org.tizen.injector.telephony.call/.settings/org.eclipse.core.resources.prefs [new file with mode: 0644]
org.tizen.injector.telephony.call/.settings/org.eclipse.core.runtime.prefs [new file with mode: 0644]
org.tizen.injector.telephony.call/META-INF/MANIFEST.MF [new file with mode: 0644]
org.tizen.injector.telephony.call/build.properties [new file with mode: 0644]
org.tizen.injector.telephony.call/icons/telephony_view.png [new file with mode: 0644]
org.tizen.injector.telephony.call/plugin.xml [new file with mode: 0644]
org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/TelephonyCall.java [new file with mode: 0644]
org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/model/CallListVO.java [new file with mode: 0644]
org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/page/MOMTCall.java [new file with mode: 0644]
org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/page/RemoteParty.java [new file with mode: 0644]
org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G01A07.java [new file with mode: 0644]
org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G01A21MO.java [new file with mode: 0644]
org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G01A21MT.java [new file with mode: 0644]
org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G01A22.java [new file with mode: 0644]
org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G01A22End.java [new file with mode: 0644]
org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G01A23.java [new file with mode: 0644]
org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G01A26.java [new file with mode: 0644]
org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G01A29.java [new file with mode: 0644]
org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G01A62.java [new file with mode: 0644]
org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G03A58.java [new file with mode: 0644]
org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G03A59.java [new file with mode: 0644]
org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G0DA09.java [new file with mode: 0644]
org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G0DA0B.java [new file with mode: 0644]
org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/resource/ErrorCode.java [new file with mode: 0644]
org.tizen.injector.telephony.sms/.classpath [new file with mode: 0644]
org.tizen.injector.telephony.sms/.project [new file with mode: 0644]
org.tizen.injector.telephony.sms/.settings/org.eclipse.core.resources.prefs [new file with mode: 0644]
org.tizen.injector.telephony.sms/.settings/org.eclipse.core.runtime.prefs [new file with mode: 0644]
org.tizen.injector.telephony.sms/META-INF/MANIFEST.MF [new file with mode: 0644]
org.tizen.injector.telephony.sms/OSGI-INF/l10n/bundle.properties [new file with mode: 0644]
org.tizen.injector.telephony.sms/build.properties [new file with mode: 0644]
org.tizen.injector.telephony.sms/icons/telephony_view.png [new file with mode: 0644]
org.tizen.injector.telephony.sms/plugin.xml [new file with mode: 0644]
org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/Messages.java [new file with mode: 0644]
org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/TelephonySMS.java [new file with mode: 0644]
org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/DecodeMsg.java [new file with mode: 0644]
org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/EncodeMsg.java [new file with mode: 0644]
org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/EnumConstants.java [new file with mode: 0644]
org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/Messages.java [new file with mode: 0644]
org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/SMS_USERDATA.java [new file with mode: 0644]
org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/SmsAddressInfo.java [new file with mode: 0644]
org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/TPDU_SMS_DELIVER.java [new file with mode: 0644]
org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/TPDU_SMS_SUBMIT.java [new file with mode: 0644]
org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/TapiNetTextCodingScheme.java [new file with mode: 0644]
org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/TapiNetTextVP.java [new file with mode: 0644]
org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/TmDateTime.java [new file with mode: 0644]
org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/messages.properties [new file with mode: 0644]
org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/messages.properties [new file with mode: 0644]
org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/page/CellBroadcasting.java [new file with mode: 0644]
org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/page/Messages.java [new file with mode: 0644]
org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/page/SMS.java [new file with mode: 0644]
org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/page/messages.properties [new file with mode: 0644]
org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/protocol/G04A01.java [new file with mode: 0644]
org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/protocol/G04A05.java [new file with mode: 0644]
org.tizen.injector/META-INF/MANIFEST.MF
org.tizen.injector/plugin.xml
org.tizen.injector/src/org/tizen/injector/DebugLog.java
org.tizen.injector/src/org/tizen/injector/Injector.java
org.tizen.injector/src/org/tizen/injector/InjectorDialog.java [new file with mode: 0644]
org.tizen.injector/src/org/tizen/injector/control/TableViewCellModifier.java [new file with mode: 0644]
org.tizen.injector/src/org/tizen/injector/control/TableViewColumnSorter.java [new file with mode: 0644]
org.tizen.injector/src/org/tizen/injector/control/TableViewContentProvider.java [new file with mode: 0644]
org.tizen.injector/src/org/tizen/injector/control/TableViewLabelProvider.java [new file with mode: 0644]
org.tizen.injector/src/org/tizen/injector/model/AbstractTableModel.java [new file with mode: 0644]
org.tizen.injector/src/org/tizen/injector/model/AbstractTableVO.java [new file with mode: 0644]
org.tizen.injector/src/org/tizen/injector/model/DefaultTableModel.java [new file with mode: 0644]
org.tizen.injector/src/org/tizen/injector/model/ITableModel.java [new file with mode: 0644]
org.tizen.injector/src/org/tizen/injector/model/ITableVO.java [new file with mode: 0644]
org.tizen.injector/src/org/tizen/injector/model/IVO.java [new file with mode: 0644]
org.tizen.injector/src/org/tizen/injector/protocol/AbstractGA.java
org.tizen.injector/src/org/tizen/injector/protocol/AbstractItem.java
org.tizen.injector/src/org/tizen/injector/protocol/ByteArrayItem.java
org.tizen.injector/src/org/tizen/injector/protocol/IntItem.java
org.tizen.injector/src/org/tizen/injector/protocol/InvalidTypeException.java
org.tizen.injector/src/org/tizen/injector/protocol/ItemType.java
org.tizen.injector/src/org/tizen/injector/protocol/StructureGA.java
org.tizen.injector/src/org/tizen/injector/protocol/sensor/AbstractSenserMessage.java
org.tizen.injector/src/org/tizen/injector/protocol/sensor/TestSensorMessage.java
org.tizen.injector/src/org/tizen/injector/provider/AbstractInjectorItem.java
org.tizen.injector/src/org/tizen/injector/provider/AbstractInjectorPage.java
org.tizen.injector/src/org/tizen/injector/receiver/AbstractInjectorReceiver.java
org.tizen.injector/src/org/tizen/injector/socket/LocationSocket.java
org.tizen.injector/src/org/tizen/injector/socket/SDcardSocket.java [new file with mode: 0644]
org.tizen.injector/src/org/tizen/injector/socket/SensorTCPSocket.java
org.tizen.injector/src/org/tizen/injector/socket/SensorUDPSocket.java
org.tizen.injector/src/org/tizen/injector/socket/TelephonySocket.java
org.tizen.injector/src/org/tizen/injector/sourceProvider/InjectorStateProvider.java
org.tizen.injector/src/org/tizen/injector/util/ByteUtil.java
org.tizen.injector/src/org/tizen/injector/util/FormPageUtil.java
org.tizen.injector/src/org/tizen/injector/util/StringUtil.java
org.tizen.injector/src/org/tizen/injector/view/InjectorView.java
org.tizen.injector/src/org/tizen/injector/view/Messages.java
org.tizen.location.core/META-INF/MANIFEST.MF [deleted file]
org.tizen.location.log/OSGI-INF/l10n/bundle.properties [deleted file]
org.tizen.location.manual/OSGI-INF/l10n/bundle.properties [deleted file]
org.tizen.location.map/.project [deleted file]
org.tizen.location.map/OSGI-INF/l10n/bundle.properties [deleted file]
org.tizen.nfc/.project [deleted file]
org.tizen.nfc/src/org/tizen/nfc/page/NfcPage.java [deleted file]
org.tizen.sensor.accelerometer/.project [deleted file]
org.tizen.sensor.light/.project [deleted file]
org.tizen.sensor.light/src/org/tizen/sensor/light/page/LightPage.java [deleted file]
org.tizen.sensor.motion/.project [deleted file]
org.tizen.sensor.proximity/.project [deleted file]
package/build.linux
package/build.windows [deleted file]
package/changelog [new file with mode: 0644]
package/pkginfo.manifest

diff --git a/AUTHORS b/AUTHORS
index fe14544..1722483 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,8 +1,6 @@
 YeongKyoon Lee <yeongkyoon.lee@samsung.com>
-DongKyun Yun <dk77.yun@samsung.com>
-DoHyung Hong <don.hong@samsung.com>
+DaiYoung Kim <daiyoung777.kim@samsung.com>
 SeokYeon Hwang <syeon.hwang@samsung.com>
-Hyunjun Son <hj79.son@samsung.com>
 SangJin Kim <sangjin3.kim@samsung.com>
 KiTae Kim <kt920.kim@samsung.com>
 JinHyung Jo <jinhyung.jo@samsung.com>
@@ -10,4 +8,5 @@ SungMin Ha <sungmin82.ha@samsung.com>
 MunKyu Im <munkyu.im@samsung.com>
 JiHye Kim <jihye1128.kim@samsung.com>
 GiWoong Kim <giwoong.kim@samsung.com>
+SooYoung Ha <yoosah.ha@samsnung.com>
 HyunGoo Kang <hyungoo1.kang@samsung.com>
similarity index 97%
rename from LICENSE
rename to LICENSE.APLv2
index bbe9d02..fc03349 100644 (file)
--- a/LICENSE
-Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
-\r
-                                 Apache License\r
-                           Version 2.0, January 2004\r
-                        http://www.apache.org/licenses/\r
-\r
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\r
-\r
-   1. Definitions.\r
-\r
-      "License" shall mean the terms and conditions for use, reproduction,\r
-      and distribution as defined by Sections 1 through 9 of this document.\r
-\r
-      "Licensor" shall mean the copyright owner or entity authorized by\r
-      the copyright owner that is granting the License.\r
-\r
-      "Legal Entity" shall mean the union of the acting entity and all\r
-      other entities that control, are controlled by, or are under common\r
-      control with that entity. For the purposes of this definition,\r
-      "control" means (i) the power, direct or indirect, to cause the\r
-      direction or management of such entity, whether by contract or\r
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the\r
-      outstanding shares, or (iii) beneficial ownership of such entity.\r
-\r
-      "You" (or "Your") shall mean an individual or Legal Entity\r
-      exercising permissions granted by this License.\r
-\r
-      "Source" form shall mean the preferred form for making modifications,\r
-      including but not limited to software source code, documentation\r
-      source, and configuration files.\r
-\r
-      "Object" form shall mean any form resulting from mechanical\r
-      transformation or translation of a Source form, including but\r
-      not limited to compiled object code, generated documentation,\r
-      and conversions to other media types.\r
-\r
-      "Work" shall mean the work of authorship, whether in Source or\r
-      Object form, made available under the License, as indicated by a\r
-      copyright notice that is included in or attached to the work\r
-      (an example is provided in the Appendix below).\r
-\r
-      "Derivative Works" shall mean any work, whether in Source or Object\r
-      form, that is based on (or derived from) the Work and for which the\r
-      editorial revisions, annotations, elaborations, or other modifications\r
-      represent, as a whole, an original work of authorship. For the purposes\r
-      of this License, Derivative Works shall not include works that remain\r
-      separable from, or merely link (or bind by name) to the interfaces of,\r
-      the Work and Derivative Works thereof.\r
-\r
-      "Contribution" shall mean any work of authorship, including\r
-      the original version of the Work and any modifications or additions\r
-      to that Work or Derivative Works thereof, that is intentionally\r
-      submitted to Licensor for inclusion in the Work by the copyright owner\r
-      or by an individual or Legal Entity authorized to submit on behalf of\r
-      the copyright owner. For the purposes of this definition, "submitted"\r
-      means any form of electronic, verbal, or written communication sent\r
-      to the Licensor or its representatives, including but not limited to\r
-      communication on electronic mailing lists, source code control systems,\r
-      and issue tracking systems that are managed by, or on behalf of, the\r
-      Licensor for the purpose of discussing and improving the Work, but\r
-      excluding communication that is conspicuously marked or otherwise\r
-      designated in writing by the copyright owner as "Not a Contribution."\r
-\r
-      "Contributor" shall mean Licensor and any individual or Legal Entity\r
-      on behalf of whom a Contribution has been received by Licensor and\r
-      subsequently incorporated within the Work.\r
-\r
-   2. Grant of Copyright License. Subject to the terms and conditions of\r
-      this License, each Contributor hereby grants to You a perpetual,\r
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
-      copyright license to reproduce, prepare Derivative Works of,\r
-      publicly display, publicly perform, sublicense, and distribute the\r
-      Work and such Derivative Works in Source or Object form.\r
-\r
-   3. Grant of Patent License. Subject to the terms and conditions of\r
-      this License, each Contributor hereby grants to You a perpetual,\r
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
-      (except as stated in this section) patent license to make, have made,\r
-      use, offer to sell, sell, import, and otherwise transfer the Work,\r
-      where such license applies only to those patent claims licensable\r
-      by such Contributor that are necessarily infringed by their\r
-      Contribution(s) alone or by combination of their Contribution(s)\r
-      with the Work to which such Contribution(s) was submitted. If You\r
-      institute patent litigation against any entity (including a\r
-      cross-claim or counterclaim in a lawsuit) alleging that the Work\r
-      or a Contribution incorporated within the Work constitutes direct\r
-      or contributory patent infringement, then any patent licenses\r
-      granted to You under this License for that Work shall terminate\r
-      as of the date such litigation is filed.\r
-\r
-   4. Redistribution. You may reproduce and distribute copies of the\r
-      Work or Derivative Works thereof in any medium, with or without\r
-      modifications, and in Source or Object form, provided that You\r
-      meet the following conditions:\r
-\r
-      (a) You must give any other recipients of the Work or\r
-          Derivative Works a copy of this License; and\r
-\r
-      (b) You must cause any modified files to carry prominent notices\r
-          stating that You changed the files; and\r
-\r
-      (c) You must retain, in the Source form of any Derivative Works\r
-          that You distribute, all copyright, patent, trademark, and\r
-          attribution notices from the Source form of the Work,\r
-          excluding those notices that do not pertain to any part of\r
-          the Derivative Works; and\r
-\r
-      (d) If the Work includes a "NOTICE" text file as part of its\r
-          distribution, then any Derivative Works that You distribute must\r
-          include a readable copy of the attribution notices contained\r
-          within such NOTICE file, excluding those notices that do not\r
-          pertain to any part of the Derivative Works, in at least one\r
-          of the following places: within a NOTICE text file distributed\r
-          as part of the Derivative Works; within the Source form or\r
-          documentation, if provided along with the Derivative Works; or,\r
-          within a display generated by the Derivative Works, if and\r
-          wherever such third-party notices normally appear. The contents\r
-          of the NOTICE file are for informational purposes only and\r
-          do not modify the License. You may add Your own attribution\r
-          notices within Derivative Works that You distribute, alongside\r
-          or as an addendum to the NOTICE text from the Work, provided\r
-          that such additional attribution notices cannot be construed\r
-          as modifying the License.\r
-\r
-      You may add Your own copyright statement to Your modifications and\r
-      may provide additional or different license terms and conditions\r
-      for use, reproduction, or distribution of Your modifications, or\r
-      for any such Derivative Works as a whole, provided Your use,\r
-      reproduction, and distribution of the Work otherwise complies with\r
-      the conditions stated in this License.\r
-\r
-   5. Submission of Contributions. Unless You explicitly state otherwise,\r
-      any Contribution intentionally submitted for inclusion in the Work\r
-      by You to the Licensor shall be under the terms and conditions of\r
-      this License, without any additional terms or conditions.\r
-      Notwithstanding the above, nothing herein shall supersede or modify\r
-      the terms of any separate license agreement you may have executed\r
-      with Licensor regarding such Contributions.\r
-\r
-   6. Trademarks. This License does not grant permission to use the trade\r
-      names, trademarks, service marks, or product names of the Licensor,\r
-      except as required for reasonable and customary use in describing the\r
-      origin of the Work and reproducing the content of the NOTICE file.\r
-\r
-   7. Disclaimer of Warranty. Unless required by applicable law or\r
-      agreed to in writing, Licensor provides the Work (and each\r
-      Contributor provides its Contributions) on an "AS IS" BASIS,\r
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\r
-      implied, including, without limitation, any warranties or conditions\r
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\r
-      PARTICULAR PURPOSE. You are solely responsible for determining the\r
-      appropriateness of using or redistributing the Work and assume any\r
-      risks associated with Your exercise of permissions under this License.\r
-\r
-   8. Limitation of Liability. In no event and under no legal theory,\r
-      whether in tort (including negligence), contract, or otherwise,\r
-      unless required by applicable law (such as deliberate and grossly\r
-      negligent acts) or agreed to in writing, shall any Contributor be\r
-      liable to You for damages, including any direct, indirect, special,\r
-      incidental, or consequential damages of any character arising as a\r
-      result of this License or out of the use or inability to use the\r
-      Work (including but not limited to damages for loss of goodwill,\r
-      work stoppage, computer failure or malfunction, or any and all\r
-      other commercial damages or losses), even if such Contributor\r
-      has been advised of the possibility of such damages.\r
-\r
-   9. Accepting Warranty or Additional Liability. While redistributing\r
-      the Work or Derivative Works thereof, You may choose to offer,\r
-      and charge a fee for, acceptance of support, warranty, indemnity,\r
-      or other liability obligations and/or rights consistent with this\r
-      License. However, in accepting such obligations, You may act only\r
-      on Your own behalf and on Your sole responsibility, not on behalf\r
-      of any other Contributor, and only if You agree to indemnify,\r
-      defend, and hold each Contributor harmless for any liability\r
-      incurred by, or claims asserted against, such Contributor by reason\r
-      of your accepting any such warranty or additional liability.\r
-\r
-   END OF TERMS AND CONDITIONS\r
-\r
-   APPENDIX: How to apply the Apache License to your work.\r
-\r
-      To apply the Apache License to your work, attach the following\r
-      boilerplate notice, with the fields enclosed by brackets "[]"\r
-      replaced with your own identifying information. (Don't include\r
-      the brackets!)  The text should be enclosed in the appropriate\r
-      comment syntax for the file format. We also recommend that a\r
-      file or class name and description of purpose be included on the\r
-      same "printed page" as the copyright notice for easier\r
-      identification within third-party archives.\r
-\r
-   Copyright [yyyy] [name of copyright owner]\r
-\r
-   Licensed under the Apache License, Version 2.0 (the "License");\r
-   you may not use this file except in compliance with the License.\r
-   You may obtain a copy of the License at\r
-\r
-       http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-   Unless required by applicable law or agreed to in writing, software\r
-   distributed under the License is distributed on an "AS IS" BASIS,\r
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-   See the License for the specific language governing permissions and\r
-   limitations under the License.\r
-\r
-\r
-\r
+Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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.
+
+
+
diff --git a/NOTICE b/NOTICE
index f085dc6..f4d073d 100644 (file)
--- a/NOTICE
+++ b/NOTICE
@@ -1 +1,3 @@
-Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
+Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+Except as noted, this software is licensed under Apache License, Version 2.
+Please, see the LICENSE.APLv2 file for Apache License Version 2, terms and conditions.
diff --git a/builder/metadata/data/IDE/plugins/org.tizen.telephony.call_1.3.20.201202101837.jar b/builder/metadata/data/IDE/plugins/org.tizen.telephony.call_1.3.20.201202101837.jar
deleted file mode 100644 (file)
index 971ecc5..0000000
Binary files a/builder/metadata/data/IDE/plugins/org.tizen.telephony.call_1.3.20.201202101837.jar and /dev/null differ
diff --git a/builder/metadata/data/IDE/plugins/org.tizen.telephony.sms_1.3.20.201202101837.jar b/builder/metadata/data/IDE/plugins/org.tizen.telephony.sms_1.3.20.201202101837.jar
deleted file mode 100644 (file)
index 447f518..0000000
Binary files a/builder/metadata/data/IDE/plugins/org.tizen.telephony.sms_1.3.20.201202101837.jar and /dev/null differ
index cc442a1..38921d7 100644 (file)
@@ -18,7 +18,7 @@
 featureName=Tizen Event Injector
 
 # "providerName" property - name of the company that provides the feature
-providerName=Tizen
+providerName=The Linux Foundation
 
 # "updateSiteName" property - label for the update site
 updateSiteName=Tizen Event Injector Updates
@@ -40,13 +40,16 @@ licenseURL=license.html
 license=\
 Tizen SDK\n\
 \n\
-Tizen SDK contains software portions licensed under various open source licenses as well as proprietary components.  All open source software portions ("Open Source Software") are licensed under the open source licenses that accompany such Open Source Software.\n\
+Tizen SDK contains software portions licensed under various open source licenses as well as proprietary components. All open source software portions ("Open Source Software") are licensed under the open source licenses that accompany such Open Source Software.\n\
  \n\
-The licenses governing the Open Source Software are available at: http://developer.tizen.org/download/tizen_sdk_opensource_license.html\n\
+The licenses governing the Open Source Software are available at: \n\
+https://developer.tizen.org/tizen-sdk-opensource-license\n\
  \n\
-Except for the Open Source Software contained in Tizen SDK, all other software portions contained in Tizen SDK are governed by the terms and conditions of the Tizen Software Development Kit License Agreement, available at: http://developer.tizen.org/download/samsung_sdk_license.html\n\
+Except for the Open Source Software and proprietary components contributed from companies other than Samsung, contained in Tizen SDK, all other software portions contained in Tizen SDK are governed by the terms and conditions of the Samsung Tizen SDK License Agreement, available at: \n\
+https://developer.tizen.org/tizen-sdk-license\n\
  \n\
-You may access and download Tizen SDK Open Source Software at: http://developer.tizen.org/download/tizenopensdk.tar.gz\n\
+The licenses of all proprietary components contributed from companies other than Samsung will be either displayed as part of their respective installers or accessed inside installation package archive of each component. You may access and download Tizen SDK Open Source Software at:\n\
+http://developer.tizen.org/download/tizenopensdk.tar.gz\n\
  \n\
-BY CLICKING THE "I AGREE" BUTTON OR BY USING ANY PART OF TIZEN SDK, YOU AGREE (ON BEHALF OF YOURSELF AND/OR YOUR COMPANY) TO THE OPEN SOURCE SOFTWARE LICENSE TERMS AND THE TIZEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT. IF YOU DO NOT AGREE WITH THE OPEN SOURCE SOFTWARE LICENSE TERMS OR THE TIZEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT, YOU MAY NOT DOWNLOAD OR USE TIZEN SDK.\n
+BY CLICKING THE "I AGREE" BUTTON OR BY USING ANY PART OF TIZEN SDK, YOU AGREE (ON BEHALF OF YOURSELF AND/OR YOUR COMPANY) TO THE OPEN SOURCE SOFTWARE LICENSE TERMS, THE SAMSUNG TIZEN SDK LICENSE AGREEMENT AND THE LICENSES OF ALL PROPRIETARY COMPONENTS CONTRIBUTED FROM COMPANIES OTHER THAN SAMSUNG. If you do not agree with the Open Source Software license terms or the SAMSUNG TIZEN SDK LICENSE AGREEMENT or THE LICENSES OF ALL PROPRIETARY COMPONENTS CONTRIBUTED FROM COMPANIES OTHER THAN SAMSUNG, you may not download or use Tizen SDK.\n
 ########### end of license property ##########################################
index a64e410..25eaab6 100644 (file)
@@ -3,7 +3,7 @@
       id="org.tizen.eventinjector.feature"
       label="Tizen Event Injector"
       version="1.0.0.qualifier"
-      provider-name="Samsung"
+      provider-name="The Linux Foundation"
       plugin="org.tizen.base.platform"
       license-feature="org.tizen.base.feature">
 
          unpack="false"/>
 
    <plugin
-         id="org.tizen.location.core"
+         id="org.tizen.injector.location.core"
          download-size="0"
          install-size="0"
          version="0.0.0"
          unpack="false"/>
 
    <plugin
-         id="org.tizen.device"
+         id="org.tizen.injector.device"
          download-size="0"
          install-size="0"
          version="0.0.0"
          unpack="false"/>
 
    <plugin
-         id="org.tizen.location.log"
+         id="org.tizen.injector.location.log"
          download-size="0"
          install-size="0"
          version="0.0.0"
          unpack="false"/>
 
    <plugin
-         id="org.tizen.location.manual"
+         id="org.tizen.injector.location.manual"
          download-size="0"
          install-size="0"
          version="0.0.0"
          unpack="false"/>
 
    <plugin
-         id="org.tizen.location.map"
+         id="org.tizen.injector.location.map"
          download-size="0"
          install-size="0"
          version="0.0.0"
          unpack="false"/>
 
    <plugin
-         id="org.tizen.sensor.motion"
+         id="org.tizen.injector.sensor.motion"
          download-size="0"
          install-size="0"
          version="0.0.0"
          unpack="false"/>
 
    <plugin
-         id="org.tizen.sensor.accelerometer"
+         id="org.tizen.injector.sensor.accelerometer"
          download-size="0"
          install-size="0"
          version="0.0.0"
          unpack="false"/>
 
    <plugin
-         id="org.tizen.sensor.light"
+         id="org.tizen.injector.sensor.light"
          download-size="0"
          install-size="0"
          version="0.0.0"
          unpack="false"/>
 
    <plugin
-         id="org.tizen.sensor.proximity"
+         id="org.tizen.injector.sensor.proximity"
          download-size="0"
          install-size="0"
          version="0.0.0"
          unpack="false"/>
 
    <plugin
-         id="org.tizen.nfc"
+         id="org.tizen.injector.nfc"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.tizen.injector.telephony.call"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.tizen.injector.telephony.sms"
          download-size="0"
          install-size="0"
          version="0.0.0"
similarity index 93%
rename from org.tizen.location.core/.project
rename to org.tizen.injector.device/.project
index dc06ccd..193d969 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
-       <name>org.tizen.location.core</name>
+       <name>org.tizen.injector.device</name>
        <comment></comment>
        <projects>
        </projects>
similarity index 58%
rename from org.tizen.device/META-INF/MANIFEST.MF
rename to org.tizen.injector.device/META-INF/MANIFEST.MF
index 98c04be..2cc7b22 100644 (file)
@@ -1,15 +1,19 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Tizen Event Injector Device
-Bundle-SymbolicName: org.tizen.device;singleton:=true
+Bundle-SymbolicName: org.tizen.injector.device;singleton:=true
 Bundle-Version: 1.0.0.qualifier
-Bundle-Vendor: Samsung
+Bundle-Vendor: The Linux Foundation
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Require-Bundle: org.tizen.injector,
+ org.tizen.injector.telephony.call,
  org.eclipse.swt;bundle-version="3.6.2",
  org.tizen.common,
  org.tizen.common.connection,
  org.eclipse.core.runtime;bundle-version="3.7.0",
  org.eclipse.core.commands;bundle-version="3.6.0"
-Import-Package: org.tizen.sdblib,
- org.eclipse.ui.plugin
+Import-Package: org.eclipse.jface.dialogs,
+ org.eclipse.jface.operation,
+ org.eclipse.ui.plugin,
+ org.tizen.sdblib,
+ org.tizen.sdblib.service
similarity index 52%
rename from org.tizen.device/plugin.xml
rename to org.tizen.injector.device/plugin.xml
index 67f0909..48758d2 100644 (file)
@@ -5,8 +5,8 @@
          point="org.tizen.injector.injectorItemProvider">
       <itemType
             category="Device"
-            class="org.tizen.device.battery.Battery"
-            id="org.tizen.device.battery"
+            class="org.tizen.injector.device.battery.Battery"
+            id="org.tizen.injector.device.battery"
             name="Battery">
       </itemType>
    </extension>
@@ -14,8 +14,8 @@
          point="org.tizen.injector.injectorItemProvider">
       <itemType
             category="Device"
-            class="org.tizen.device.earjack.Earjack"
-            id="org.tizen.device.earjack"
+            class="org.tizen.injector.device.earjack.Earjack"
+            id="org.tizen.injector.device.earjack"
             name="EarJack">
       </itemType>
    </extension>
@@ -23,8 +23,8 @@
          point="org.tizen.injector.injectorItemProvider">
       <itemType
             category="Device"
-            class="org.tizen.device.usb.Usb"
-            id="org.tizen.device.usb"
+            class="org.tizen.injector.device.usb.Usb"
+            id="org.tizen.injector.device.usb"
             name="USB">
       </itemType>
    </extension>
          point="org.tizen.injector.injectorItemProvider">
       <itemType
             category="Device"
-            class="org.tizen.device.rssi.Rssi"
-            id="org.tizen.device.rssi"
+            class="org.tizen.injector.device.rssi.Rssi"
+            id="org.tizen.injector.device.rssi"
             name="RSSI">
       </itemType>
    </extension>
+   <extension
+         point="org.tizen.injector.injectorItemProvider">
+      <itemType
+            category="Device"
+            class="org.tizen.injector.device.sdcard.Sdcard"
+            id="org.tizen.injector.device.sdcard"
+            name="SD Card">
+      </itemType>
+   </extension>
 
 </plugin>
@@ -1,11 +1,12 @@
 /*
- * org.tizen.device.battery
+ * org.tizen.injector.device.battery
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.device.battery;
+package org.tizen.injector.device.battery;
 
+import org.tizen.injector.device.battery.page.BatteryPage;
 import org.tizen.injector.provider.AbstractInjectorItem;
-import org.tizen.device.battery.page.BatteryPage;
 
 public class Battery extends AbstractInjectorItem{
 
@@ -1,11 +1,12 @@
 /*
- * org.tizen.device.battery
+ * org.tizen.injector.device.battery
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,7 +25,7 @@
  * 
  */
 
-package org.tizen.device.battery.page;
+package org.tizen.injector.device.battery.page;
 
 public class BatteryConstants {
        public static final String Connect = "Connect";
@@ -1,11 +1,12 @@
 /*
- * org.tizen.device.battery
+ * org.tizen.injector.device.battery
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.device.battery.page;
+package org.tizen.injector.device.battery.page;
+
+import java.io.IOException;
 
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
 import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
-//import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Slider;
 import org.eclipse.swt.widgets.Text;
-
+import org.tizen.common.connection.ConnectionPlugin;
+import org.tizen.common.connection.ConnectionPlugin.ISelectionListener;
 import org.tizen.injector.protocol.sensor.TestSensorMessage;
 import org.tizen.injector.provider.AbstractInjectorItem;
 import org.tizen.injector.provider.AbstractInjectorPage;
 import org.tizen.injector.view.InjectorView;
-import org.tizen.common.connection.ConnectionPlugin;
-import org.tizen.common.connection.ConnectionPlugin.ISelectionListener;
-import org.tizen.common.util.DialogUtil;
-import org.tizen.sdblib.FileListingService.FileEntry;
 import org.tizen.sdblib.IDevice;
+import org.tizen.sdblib.service.FileEntry;
 
 public class BatteryPage extends AbstractInjectorPage implements ISelectionListener {  
        private Text sliderText;
@@ -54,9 +57,9 @@ public class BatteryPage extends AbstractInjectorPage implements ISelectionListe
        private final String levelNumber = "8\n";
        private final String batteryLevel = "Level    : ";
        private final String batteryCharger = "Charger : ";
-       private int sendData = 100;
+       private int sendData = 50, preSendData = -1;
        private Button radioButton[];
-       private int sensorOn;
+       private int sensorOn = 0, preSensorOn = -1;
        private IDevice currentDevice;
        
        public BatteryPage(AbstractInjectorItem item, String name) {
@@ -69,18 +72,20 @@ public class BatteryPage extends AbstractInjectorPage implements ISelectionListe
                InjectorView.getDefault().addSelectionListener(this);
                sensorOn = 0;
                
-               Composite mainComposite = formUtil.createComposite(parent, 3);
+               Composite mainComposite = formUtil.createComposite(parent, 4);
                formUtil.createLabel(mainComposite, batteryLevel);
                slider = formUtil.createSlider(mainComposite, SWT.HORIZONTAL);
-               slider.setValues(100, 1, 101, 1, 1, 1);
+               slider.setValues(50, 1, 101, 1, 1, 1);
                slider.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
-               sliderText = formUtil.createText(mainComposite, Integer.toString(slider.getSelection()));
-               sliderText.setEditable(false);
-               GridData gd = new GridData(GridData.BEGINNING, GridData.CENTER, false, false);
+               sliderText = new Text(mainComposite, SWT.COLOR_BLACK);
+               sliderText.setText(String.format("%d", slider.getSelection()));
+               sliderText.setEnabled(false);
+               
+               GridData gd = new GridData(GridData.CENTER, GridData.CENTER, false, false);
                gd.widthHint = 24;
                sliderText.setLayoutData(gd);
                sendData = slider.getSelection();
-               /*
+               
                slider.addSelectionListener(new SelectionListener() {
                        @Override
                        public void widgetDefaultSelected(SelectionEvent e) {
@@ -88,29 +93,73 @@ public class BatteryPage extends AbstractInjectorPage implements ISelectionListe
                        }
                        @Override
                        public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
                                sendData = slider.getSelection();
                                sliderText.setText(Integer.toString(sendData));
-                               sendMessage(sendData, sensorOn);
                        }
                });
-               */
-               slider.addMouseListener(new MouseListener() {
+               
+               Button sendButton = formUtil.createButton(mainComposite, "Send", SWT.PUSH);
+               gd = new GridData(SWT.NONE, SWT.FILL, false, true);
+               gd.widthHint = 50;
+               sendButton.setLayoutData(gd);
+               
+               sendButton.addMouseListener(new MouseListener() {
                        @Override
                        public void mouseDoubleClick(MouseEvent e) {
+                               // TODO Auto-generated method stub
                        }
                        @Override
                        public void mouseDown(MouseEvent e) {
+                               // TODO Auto-generated method stub
                        }
                        @Override
                        public void mouseUp(MouseEvent e) {
-                               sendData = slider.getSelection();
-                               slider.setSelection(sendData);
-                               sliderText.setText(Integer.toString(sendData));
-                               sendMessage(sendData, sensorOn);
+                               // TODO Auto-generated method stub
+                               sendMessage(1, sendData);
                        }
                });
-
+               
+               sendButton.addKeyListener(new KeyListener() {
+                       @Override
+                       public void keyPressed(KeyEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+                       @Override
+                       public void keyReleased(KeyEvent e) {
+                               // TODO Auto-generated method stub
+                               if(e.keyCode == 13 || e.keyCode == 16777296)    // enter
+                               {
+                                       sendMessage(1, sendData);
+                               }
+                       }
+               });
+               
                Composite secondComposite = formUtil.createComposite(parent, 5);
+               secondComposite.addMouseListener(new MouseListener() {
+                       @Override
+                       public void mouseDoubleClick(MouseEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+                       @Override
+                       public void mouseDown(MouseEvent e) {
+                               // TODO Auto-generated method stub
+                               for( int i = 0 ; i < radioButton.length ; i++ ) {
+                                       if(radioButton[i].getSelection()) {
+                                               if( i == 0 ) { // On
+                                                       radioButton[0].setFocus();
+                                               }
+                                               else {  // Off
+                                                       radioButton[1].setFocus();
+                                               }
+                                       }
+                               }
+                       }
+                       @Override
+                       public void mouseUp(MouseEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
                formUtil.createLabel(secondComposite, batteryCharger);
                radioButton = new Button[2];
                radioButton[0] = formUtil.createButton(secondComposite, BatteryConstants.Connect, SWT.RADIO);
@@ -134,6 +183,8 @@ public class BatteryPage extends AbstractInjectorPage implements ISelectionListe
                                {
                                        if(radioButton[i].getSelection()) {
                                                if( i == 0 ) { // On
+                                                       if(preSensorOn == 1)
+                                                               return;
                                                        sensorOn = 1;
                                                }
                                                else {  // Off
@@ -143,7 +194,7 @@ public class BatteryPage extends AbstractInjectorPage implements ISelectionListe
                                }
                                
                                super.widgetSelected(e);
-                               sendMessage(sendData, sensorOn);
+                               sendMessage(2, sensorOn);
                        }
                });
 
@@ -165,15 +216,25 @@ public class BatteryPage extends AbstractInjectorPage implements ISelectionListe
                // TODO Auto-generated method stub
                
        }
-       public void sendMessage(int level, int charger) {
-                       TestSensorMessage msg = new TestSensorMessage(level, charger);
+       public void sendMessage(int id, int data) {
+                       if(id == 1 && preSendData == data)      // level
+                               return;
+                               
+                       TestSensorMessage msg = new TestSensorMessage(id, data);
                        try {
                        //      sensorSocket.send(levelNumber + msg.getMessage());
                                injectorSocket.sendSensor(levelNumber + msg.getMessage());
+                       } catch (IOException e1) {
+                               e1.printStackTrace();
                        } catch (Exception e1) {
                                // TODO Auto-generated catch block
                                e1.printStackTrace();
                        }
+
+                       if(id == 1)                             // level
+                               preSendData = data;
+                       else if(id == 2)                        // charger
+                               preSensorOn = data;
        }
 
 //     @Override
@@ -181,12 +242,18 @@ public class BatteryPage extends AbstractInjectorPage implements ISelectionListe
                // TODO Auto-generated method stub
                currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
                
-               slider.setSelection(100);
+               slider.setSelection(50);
                sendData = slider.getSelection();
                sliderText.setText(Integer.toString(sendData));
                
                radioButton[0].setSelection(false);
                radioButton[1].setSelection(true);
+
+               // set default values
+               sensorOn = 0;
+               
+               sendMessage(1, sendData);
+               sendMessage(2, sensorOn);
        }
 
 //     @Override
@@ -203,22 +270,20 @@ public class BatteryPage extends AbstractInjectorPage implements ISelectionListe
 
        @Override
        public void selectionChanged(FileEntry selectedEntry) {
-               if( selectedEntry == null)
-               {
+               if (selectedEntry == null) {
                        disconnect();
-                       return;
-               }
-               else if (!selectedEntry.getFileListingService().getDevice().isEmulator())
-                       return;
-               
-               if(currentDevice == null && selectedEntry.getName() != null)
-                       connect();
-               else if(currentDevice == null && selectedEntry.getName() == null)
-                       return;
-               else if (currentDevice.getSerialNumber() != selectedEntry.getName()) {
-                       disconnect();
-                       connect();
+               } else {
+                       String selectedName = selectedEntry.getDevice().getSerialNumber();
+                       if (currentDevice == null) {
+                               if (selectedName != null) {
+                                       connect();
+                               }
+                       } else {
+                               if (currentDevice.getSerialNumber() != selectedName) {
+                                       disconnect();
+                                       connect();
+                               }
+                       }
                }
-               sendMessage(sendData, sensorOn);
        }
 }
@@ -1,11 +1,12 @@
 /*
- * org.tizen.device.earjack
+ * org.tizen.injector.device.earjack
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.device.earjack;
+package org.tizen.injector.device.earjack;
 
+import org.tizen.injector.device.earjack.page.EarjackPage;
 import org.tizen.injector.provider.AbstractInjectorItem;
-import org.tizen.device.earjack.page.EarjackPage;
 
 public class Earjack extends AbstractInjectorItem{
 
@@ -1,11 +1,12 @@
 /*
- * org.tizen.device.earjack
+ * org.tizen.injector.device.earjack
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.device.earjack.page;
+package org.tizen.injector.device.earjack.page;
 
 public class EarjackConstants {
        public static final String wire3= "3 Wire";
        public static final String wire4 = "4 Wire";
        public static final String disconnect = "Disconnect";
+
+       public static final int WIRE_3 = 1;
+       public static final int WIRE_4 = 3;
+       public static final int DISCONNECT = 0;
 }
@@ -1,11 +1,12 @@
 /*
- * org.tizen.device.earjack
+ * org.tizen.injector.device.earjack
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.device.earjack.page;
+package org.tizen.injector.device.earjack.page;
 
+import java.io.IOException;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.SWT;
-
 import org.tizen.common.connection.ConnectionPlugin;
 import org.tizen.common.connection.ConnectionPlugin.ISelectionListener;
-import org.tizen.sdblib.FileListingService.FileEntry;
-import org.tizen.sdblib.IDevice;
 import org.tizen.injector.protocol.sensor.TestSensorMessage;
 import org.tizen.injector.provider.AbstractInjectorItem;
 import org.tizen.injector.provider.AbstractInjectorPage;
 import org.tizen.injector.view.InjectorView;
+import org.tizen.sdblib.IDevice;
+import org.tizen.sdblib.service.FileEntry;
 
 public class EarjackPage extends AbstractInjectorPage implements ISelectionListener {
 
@@ -58,11 +62,36 @@ public class EarjackPage extends AbstractInjectorPage implements ISelectionListe
                InjectorView.getDefault().addSelectionListener(this);
                currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
                
-               Composite mainComposite = formUtil.createComposite(parent, 6);
+               //Composite mainComposite = formUtil.createComposite(parent, 1);        // for focus when mouse click
+               Composite subComposite = formUtil.createComposite(parent, 6);
+               subComposite.addMouseListener(new MouseListener(){
+                       @Override
+                       public void mouseDoubleClick(MouseEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+                       @Override
+                       public void mouseDown(MouseEvent e) {
+                               // TODO Auto-generated method stub
+                               for( int i = 0 ; i < radioButton.length ; i++ ) {
+                                       if(radioButton[i].getSelection()) {
+                                               if( i == 0 )    // 3wire
+                                                       radioButton[0].setFocus();
+                                               else if(i == 1)  // 4wire
+                                                       radioButton[1].setFocus();
+                                               else
+                                                       radioButton[2].setFocus();
+                                       }
+                               }
+                       }
+                       @Override
+                       public void mouseUp(MouseEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
                radioButton = new Button[3];
-               radioButton[0] = formUtil.createButton(mainComposite, EarjackConstants.wire3, SWT.RADIO);
-               radioButton[1] = formUtil.createButton(mainComposite, EarjackConstants.wire4, SWT.RADIO);
-               radioButton[2] = formUtil.createButton(mainComposite, EarjackConstants.disconnect, SWT.RADIO);
+               radioButton[0] = formUtil.createButton(subComposite, EarjackConstants.wire3, SWT.RADIO);
+               radioButton[1] = formUtil.createButton(subComposite, EarjackConstants.wire4, SWT.RADIO);
+               radioButton[2] = formUtil.createButton(subComposite, EarjackConstants.disconnect, SWT.RADIO);
                radioButton[2].setSelection(true);
                for( int i = 0 ; i < radioButton.length ; i++ ) {
                        if(radioButton[i].getSelection()) {
@@ -149,25 +178,28 @@ public class EarjackPage extends AbstractInjectorPage implements ISelectionListe
        }
 
        public void sendMessage(int status) {
-               if(tmp_status != status)
-               {
+//             if(tmp_status != status)
+//             {
                        TestSensorMessage msg = new TestSensorMessage(status);
                        try {
                        //      sensorSocket.send(sensorNumber + msg.getMessage());
                                injectorSocket.sendSensor(sensorNumber + msg.getMessage());
+                       } catch (IOException e1) {
+                               e1.printStackTrace();
                        } catch (Exception e1) {
                                // TODO Auto-generated catch block
                                e1.printStackTrace();
                        }
                        tmp_status = status;
-               }
+//             }
        }
 
 //     @Override
        public void connect() {
                // TODO Auto-generated method stub
                currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
-               
+
+               earjack_status = EarjackConstants.DISCONNECT;
                radioButton[0].setSelection(false);
                radioButton[1].setSelection(false);
                radioButton[2].setSelection(true);
@@ -187,23 +219,20 @@ public class EarjackPage extends AbstractInjectorPage implements ISelectionListe
 
        @Override
        public void selectionChanged(FileEntry selectedEntry) {
-               if( selectedEntry == null)
-               {
+               if (selectedEntry == null) {
                        disconnect();
-                       return;
-               }
-               else if (!selectedEntry.getFileListingService().getDevice().isEmulator())
-                       return;
-               
-               if(currentDevice == null && selectedEntry.getName() != null) {
-                       connect();
-               } else if(currentDevice == null && selectedEntry.getName() == null) {
-                       return;
-               } else if (currentDevice.getSerialNumber() != selectedEntry.getName()) {
-                       disconnect();
-                       connect();
-               } else if (currentDevice.getSerialNumber() == selectedEntry.getName()) {
-                       return;
+               } else {
+                       String selectedName = selectedEntry.getDevice().getSerialNumber();
+                       if (currentDevice == null) {
+                               if (selectedName != null) {
+                                       connect();
+                               }
+                       } else {
+                               if (currentDevice.getSerialNumber() != selectedName) {
+                                       disconnect();
+                                       connect();
+                               }
+                       }
                }
                sendMessage(earjack_status);
        }
@@ -1,11 +1,12 @@
 /*
- * org.tizen.device.rssi
+ * org.tizen.injector.device.rssi
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.device.rssi;
+package org.tizen.injector.device.rssi;
 
+import org.tizen.injector.device.rssi.page.RssiPage;
 import org.tizen.injector.provider.AbstractInjectorItem;
-import org.tizen.device.rssi.page.RssiPage;
 
 public class Rssi extends AbstractInjectorItem{
 
diff --git a/org.tizen.injector.device/src/org/tizen/injector/device/rssi/page/G02A31.java b/org.tizen.injector.device/src/org/tizen/injector/device/rssi/page/G02A31.java
new file mode 100644 (file)
index 0000000..31aad26
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * org.tizen.injector.device.rssi.page
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.device.rssi.page;
+
+import org.tizen.injector.protocol.AbstractGA;
+import org.tizen.injector.protocol.StructureGA;
+
+public class G02A31 extends AbstractGA{
+
+       public G02A31(){
+               super(0x02, 0x31);
+       }
+
+       @Override
+       protected void makeBody() {
+               StructureGA ga = getBody();
+               ga.addByteItem("NET_ACT_TYPE");
+               ga.addByteItem("NET_SVC_DOMAIN");
+               ga.addByteItem("NET_REG_STATUS");
+               ga.addByteItem("NET_EDGE_SUPPORT");
+               ga.addByteItem("LAC0");
+               ga.addByteItem("LAC1");
+               ga.addByteItem("CELL_ID0");
+               ga.addByteItem("CELL_ID1");
+               ga.addByteItem("CELL_ID2");
+               ga.addByteItem("CELL_ID3");
+               ga.addByteItem("REJ_CAUSE");
+       }
+
+       @Override
+       protected void makeHeader() {
+       }
+}
@@ -1,11 +1,12 @@
 /*
- * org.tizen.device.rssi
+ * org.tizen.injector.device.rssi
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.device.rssi.page;
+package org.tizen.injector.device.rssi.page;
+
+import java.io.IOException;
 
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
 import org.eclipse.swt.events.MouseEvent;
-//import org.eclipse.swt.events.SelectionEvent;
-//import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Slider;
 import org.eclipse.swt.widgets.Text;
-
 import org.tizen.common.connection.ConnectionPlugin;
 import org.tizen.common.connection.ConnectionPlugin.ISelectionListener;
-import org.tizen.sdblib.FileListingService.FileEntry;
-import org.tizen.sdblib.IDevice;
+import org.tizen.injector.protocol.StructureGA;
 import org.tizen.injector.protocol.sensor.TestSensorMessage;
 import org.tizen.injector.provider.AbstractInjectorItem;
 import org.tizen.injector.provider.AbstractInjectorPage;
+import org.tizen.injector.telephony.call.TelephonyCall;
 import org.tizen.injector.view.InjectorView;
+import org.tizen.sdblib.IDevice;
+import org.tizen.sdblib.service.FileEntry;
 
 public class RssiPage extends AbstractInjectorPage implements ISelectionListener {     
        private Text sliderText;
@@ -52,6 +59,8 @@ public class RssiPage extends AbstractInjectorPage implements ISelectionListener
        private final String rssiLevel = "Level    : ";
        private int sendData = -1; // initial level
        private IDevice currentDevice;
+       boolean isRssi0 = false;
+       boolean isFirst = true;
        
        public RssiPage(AbstractInjectorItem item, String name) {
                super(item, name);
@@ -62,52 +71,97 @@ public class RssiPage extends AbstractInjectorPage implements ISelectionListener
                InjectorView.getDefault().addSelectionListener(this);
                currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
                
-               Composite mainComposite = formUtil.createComposite(parent, 3);
+               Composite mainComposite = formUtil.createComposite(parent, 4);
                formUtil.createLabel(mainComposite, rssiLevel);
                slider = formUtil.createSlider(mainComposite, SWT.HORIZONTAL);
-               slider.setValues(5, 0, 6, 1, 1, 1);
+               slider.setValues(4, 0, 5, 1, 1, 1);
                slider.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
-               sliderText = formUtil.createText(mainComposite, Integer.toString(slider.getSelection()));
-               sliderText.setEditable(false);
+               sliderText = new Text(mainComposite, SWT.COLOR_BLACK);
+               sliderText.setText(String.format("%d", slider.getSelection()));
+               sliderText.setEnabled(false);
                GridData gd = new GridData(GridData.BEGINNING, GridData.CENTER, false, false);
                gd.widthHint = 10;
                sliderText.setLayoutData(gd);
                sendData = slider.getSelection();
-               /*
+               
                slider.addSelectionListener(new SelectionListener() {
                        @Override
-                       public void widgetDefaultSelected(SelectionEvent e) {
-                               // TODO Auto-generated method stub
-                       }
-                       @Override
                        public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
                                sendData = slider.getSelection();
                                sliderText.setText(Integer.toString(sendData));
-                               sendLevelMessage(sendData);
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
                        }
                });
-               */
-               slider.addMouseListener(new MouseListener() {
+               
+               Button sendButton = formUtil.createButton(mainComposite, "Send", SWT.PUSH);
+               gd = new GridData(SWT.NONE, SWT.FILL, false, true);
+               gd.widthHint = 50;
+               sendButton.setLayoutData(gd);
+               
+               sendButton.addMouseListener(new MouseListener() {
                        @Override
                        public void mouseDoubleClick(MouseEvent e) {
+                               // TODO Auto-generated method stub
                        }
                        @Override
                        public void mouseDown(MouseEvent e) {
+                               // TODO Auto-generated method stub
                        }
                        @Override
                        public void mouseUp(MouseEvent e) {
-                               sendData = slider.getSelection();
-                               slider.setSelection(sendData);
-                               sliderText.setText(Integer.toString(sendData));
-                               sendLevelMessage(sendData);
+                               // TODO Auto-generated method stub
+                               sendRSSI();
+                       }
+               });
+               
+               sendButton.addKeyListener(new KeyListener() {
+                       @Override
+                       public void keyPressed(KeyEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+                       @Override
+                       public void keyReleased(KeyEvent e) {
+                               // TODO Auto-generated method stub
+                               if(e.keyCode == 13 || e.keyCode == 16777296)    // enter
+                               {
+                                       sendRSSI();
+                               }
                        }
                });
+
                
                boolean connected = checkDeviceConnectedAlready();
                if (connected == true) {
                        connect();
                }
        }
+       
+       public void sendRSSI() {
+               sendLevelMessage(sendData);
+               if(sendData == 0)
+               {
+                       if(!isRssi0)
+                       {
+                               sendNetStatus(false);
+                               TelephonyCall.getinstance().setRssiStatus(false);
+                       }
+                       isRssi0 = true;
+               }
+               else
+               {
+                       if(isRssi0)
+                       {
+                               sendNetStatus(true);
+                               TelephonyCall.getinstance().setRssiStatus(true);
+                       }
+                       isRssi0 = false;
+               }
+               slider.setSelection(sendData);
+       }
 
        private boolean checkDeviceConnectedAlready() {
                if (currentDevice == null)
@@ -121,11 +175,52 @@ public class RssiPage extends AbstractInjectorPage implements ISelectionListener
                // TODO Auto-generated method stub
                
        }
+       
+       public void sendNetStatus(boolean status) {
+               int netType = 0x02;     // UMTS
+               int netServiceDomain = 0x01;    // Combined(CS + PS) Mode
+               int netRegStatus = status ? 0x01 : 0x00;        
+               int netEdgeSupport = 0x00;              // GSM_NET_EDGE_NOTSUPPORT
+               int lac0 = 0x11;
+               int lac1 = 0x20;
+               int id0 = 0x00;
+               int id1 = 0x00;
+               int id2 = 0x00;
+               int id3 = 0x0A;
+               int rejCause = 0x00;
+               
+               G02A31 ga = new G02A31();
+               ga.intialize();
+               
+               StructureGA sga = ga.getBody();
+               sga.setInt("NET_ACT_TYPE", netType);
+               sga.setInt("NET_SVC_DOMAIN", netServiceDomain);
+               sga.setInt("NET_REG_STATUS", netRegStatus);
+               sga.setInt("NET_EDGE_SUPPORT", netEdgeSupport);
+               sga.setInt("LAC0", lac0);
+               sga.setInt("LAC1", lac1);
+               sga.setInt("CELL_ID0", id0);
+               sga.setInt("CELL_ID1", id1);
+               sga.setInt("CELL_ID2", id2);
+               sga.setInt("CELL_ID3", id3);
+               sga.setInt("REJ_CAUSE", rejCause);
+               
+               try {
+                       injectorSocket.send(ga);
+               } catch (IOException e) {
+                       e.printStackTrace();
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+       
        public void sendLevelMessage(int level) {
                        TestSensorMessage msg = new TestSensorMessage(level);
                        try {
                        //      sensorSocket.send(levelNumber + msg.getMessage());
                                injectorSocket.sendSensor(levelNumber + msg.getMessage());
+                       } catch (IOException e1) {
+                               e1.printStackTrace();
                        } catch (Exception e1) {
                                // TODO Auto-generated catch block
                                e1.printStackTrace();
@@ -137,9 +232,11 @@ public class RssiPage extends AbstractInjectorPage implements ISelectionListener
                // TODO Auto-generated method stub
                currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
                
-               slider.setSelection(5);
+               slider.setSelection(4);
                sendData = slider.getSelection();
                sliderText.setText(Integer.toString(sendData));
+               sendRSSI();
+               sendNetStatus(true);
        }
 
 //     @Override
@@ -156,22 +253,20 @@ public class RssiPage extends AbstractInjectorPage implements ISelectionListener
 
        @Override
        public void selectionChanged(FileEntry selectedEntry) {
-               if( selectedEntry == null)
-               {
+               if (selectedEntry == null) {
                        disconnect();
-                       return;
-               }
-               else if (!selectedEntry.getFileListingService().getDevice().isEmulator())
-                       return;
-               
-               if(currentDevice == null && selectedEntry.getName() != null)
-                       connect();
-               else if(currentDevice == null && selectedEntry.getName() == null)
-                       return;
-               else if (currentDevice.getSerialNumber() != selectedEntry.getName()) {
-                       disconnect();
-                       connect();
+               } else {
+                       String selectedName = selectedEntry.getDevice().getSerialNumber();
+                       if (currentDevice == null) {
+                               if (selectedName != null) {
+                                       connect();
+                               }
+                       } else {
+                               if (currentDevice.getSerialNumber() != selectedName) {
+                                       disconnect();
+                                       connect();
+                               }
+                       }
                }
-               sendLevelMessage(sendData);
        }
 }
@@ -1,12 +1,12 @@
 /*
- * org.tizen.sensor.accelerometer
+ * org.tizen.injector.device.usb
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.sensor.accelerometer;
+package org.tizen.injector.device.sdcard;
 
+import org.tizen.injector.device.sdcard.page.SdcardPage;
 import org.tizen.injector.provider.AbstractInjectorItem;
-import org.tizen.sensor.accelerometer.page.Accelerometer;
 
-public class Sensor extends AbstractInjectorItem {
+public class Sdcard extends AbstractInjectorItem{
 
        @Override
        protected void addPages() {
-               addPage(new Accelerometer(this, "Accelerometer, Gyroscope, Geomagnetic"));
+               addPage(new SdcardPage(this, "SD Card"));
+               
        }
+
 }
diff --git a/org.tizen.injector.device/src/org/tizen/injector/device/sdcard/page/SdcardConstants.java b/org.tizen.injector.device/src/org/tizen/injector/device/sdcard/page/SdcardConstants.java
new file mode 100644 (file)
index 0000000..833fde9
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * org.tizen.injector.device.usb
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.device.sdcard.page;
+
+public class SdcardConstants {
+       public static final String thisCR = System.getProperty("line.separator");
+       public static final String label1 = "Select SD Card : ";
+       public static final String button1 = "Attach";
+       public static final String button2 = "Detach";
+       public static final String warnPopup = "If you detach the SDcard without unmount,"
+                                                                                       + thisCR + "the SDcard filesystem might be crashed."
+                                                                                       + thisCR + thisCR + "Do you want to detach the SDcard?";
+}
diff --git a/org.tizen.injector.device/src/org/tizen/injector/device/sdcard/page/SdcardPage.java b/org.tizen.injector.device/src/org/tizen/injector/device/sdcard/page/SdcardPage.java
new file mode 100644 (file)
index 0000000..c6557cc
--- /dev/null
@@ -0,0 +1,356 @@
+/*
+ * org.tizen.injector.device.usb
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.device.sdcard.page;
+
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.common.connection.ConnectionPlugin;
+import org.tizen.common.connection.ConnectionPlugin.ISelectionListener;
+import org.tizen.injector.InjectorDialog;
+import org.tizen.injector.provider.AbstractInjectorItem;
+import org.tizen.injector.provider.AbstractInjectorPage;
+import org.tizen.injector.socket.SDcardSocket;
+import org.tizen.injector.view.InjectorView;
+import org.tizen.sdblib.IDevice;
+import org.tizen.sdblib.service.FileEntry;
+
+public class SdcardPage extends AbstractInjectorPage implements ISelectionListener {
+
+       public SdcardPage(AbstractInjectorItem item, String name) {
+               super(item, name);
+               // TODO Auto-generated constructor stub
+       }
+
+       private IDevice currentDevice;
+       private Combo cmbRecordFormat;
+       private String[] RecordFormatList       = RecordFormat.getInstance().getList();
+       Button button_mount, button_umount;
+       
+       private boolean isMounted = false, umountOk = true;
+       private boolean isOldEmul = false;
+       
+       @Override
+       protected void createContents() {
+               InjectorView.getDefault().addSelectionListener(this);
+               currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
+               
+               GridData gd1 = new GridData();
+               gd1.widthHint = 200;
+               
+               Composite mainComposite = formUtil.createComposite(parent, 2);
+               formUtil.createLabel(mainComposite, SdcardConstants.label1);
+               cmbRecordFormat = formUtil.createCombo(mainComposite);
+               cmbRecordFormat.setLayoutData(gd1);
+               formUtil.addComboItem(cmbRecordFormat, RecordFormatList);
+               cmbRecordFormat.select(0);
+               
+               Composite buttonComposite = formUtil.createComposite(parent, 2);
+               button_mount = formUtil.createButton(buttonComposite, SdcardConstants.button1, SWT.PUSH);                       
+               
+               button_umount = formUtil.createButton(buttonComposite, SdcardConstants.button2, SWT.PUSH);
+               button_umount.setEnabled(false);
+
+               button_mount.addSelectionListener(new SelectionListener(){
+                       @Override
+                       public void widgetSelected(SelectionEvent event) {
+                               if(SDcardSocket.getInstance().SDpath_set.contains(cmbRecordFormat.getText()))
+                               {
+                                       // sdcard is already mounted from other emulator.
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, cmbRecordFormat.getText() + " is already mounted from other emulator.\nPlease try again later.");
+                                       return;
+                               }
+                               else
+                               {                               
+                                       SDcardSocket.getInstance().isMounted = false;
+                                       sendMessage(1 + "\n" + cmbRecordFormat.getText() + "\n");
+                                       try {
+                                                       new ProgressMonitorDialog(parent.getShell()).run(true, true,
+                                                                       new IRunnableWithProgress() {
+                                                                               public void run(IProgressMonitor monitor)
+                                                                                               throws InvocationTargetException,
+                                                                                               InterruptedException {
+                                                                                       while(true)
+                                                                                       {
+                                                                                               if(monitor.isCanceled())
+                                                                                                       break;
+                                                                                               
+                                                                                               isMounted = SDcardSocket.getInstance().isMounted;
+                                                                                               if(isMounted)
+                                                                                                       break;
+                                                                                               
+                                                                                               Thread.sleep(100);
+                                                                                       }
+                                                                       }
+                                                       });
+                                       } catch (InterruptedException e) {
+                                               e.printStackTrace();
+                                       } catch (Exception e) {
+                                               e.printStackTrace();
+                                       }
+                                       
+                                       if(isMounted)
+                                       {
+                                               mntButtonClick();
+                                       }
+                                       else
+                                       {
+                                               umntButtonClick();
+                                               sendMessage(0 + "\n");
+                                       }
+                               }
+                       }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
+               });
+               
+               button_umount.addSelectionListener(new SelectionListener(){
+                       @Override
+                       public void widgetSelected(SelectionEvent event) {
+                               if(InjectorDialog.openSelectDialog(parent.getShell(), InjectorDialog.TITLE, SdcardConstants.warnPopup) == true){
+                                       sendMessage(0 + "\n");
+                                       try {
+                                               new ProgressMonitorDialog(parent.getShell()).run(true, true,
+                                                               new IRunnableWithProgress() {
+                                                                       public void run(IProgressMonitor monitor)
+                                                                                       throws InvocationTargetException,
+                                                                                       InterruptedException {
+                                                                                               while(true)
+                                                                                               {
+                                                                                                       if(monitor.isCanceled())
+                                                                                                               break;
+
+                                                                                                       isMounted = SDcardSocket.getInstance().isMounted;
+                                                                                                       if(!isMounted)
+                                                                                                               break;
+
+                                                                                                       umountOk = SDcardSocket.getInstance().umountOk;
+                                                                                                       if(!umountOk)
+                                                                                                               break;
+
+                                                                                                       Thread.sleep(100);
+                                                                                               }
+                                                                       }
+                                                       });
+                                       } catch (InterruptedException e) {
+                                               e.printStackTrace();
+                                       } catch (Exception e) {
+                                               e.printStackTrace();
+                                       }
+
+                                       if(!umountOk)
+                                       {
+                                               // sdcard is already mounted from other emulator.
+                                               Shell shell = parent.getShell();
+                                               InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Device or resource is busy.\nPlease try again later.");
+                                               mntButtonClick();
+                                               SDcardSocket.getInstance().umountOk = true;
+                                       }
+                                       else
+                                               umntButtonClick();
+                               }
+                       }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
+               });
+       
+               boolean connected = checkDeviceConnectedAlready();
+               if (connected == true) {
+//                     try {
+                               connect();
+/*                     } catch (RuntimeException e1) {
+                               e1.printStackTrace();
+                       } catch (Exception e1) {
+                               // TODO Auto-generated catch block
+                               e1.printStackTrace();
+                       }*/
+               }
+       }
+       
+       private boolean checkDeviceConnectedAlready() {
+               if (currentDevice == null)
+                       return false;
+               else
+                       return true;
+       }
+       
+       @Override
+       protected void registerReceivers() {
+               // TODO Auto-generated method stub
+               
+       }
+       
+       public void sendMessage(String sdcardData) {
+                       try {
+                               SDcardSocket.getInstance().sendSDcard(sdcardData);
+                       } catch (IOException e1) {
+                               e1.printStackTrace();
+                       } catch (Exception e1) {
+                               // TODO Auto-generated catch block
+                               e1.printStackTrace();
+                       }
+       }
+       
+       //@Override
+       public void connect() {
+               // TODO Auto-generated method stub
+               int sleepCnt = 0;
+               currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
+               
+               try {
+                       SDcardSocket sdsock = SDcardSocket.getInstance();
+                       sdsock.queryMountStatus();
+                       sdsock.connect();
+                       sdsock.isDataWaiting = true;
+                       sdsock.getCurrentMountStatus();
+                       
+                       while(sdsock.isDataWaiting)
+                       {
+                               if(sleepCnt > 200)
+                               {
+                                       sleepCnt = 0;
+                                       sdsock.isDataWaiting = false;
+                                       isOldEmul = true;
+                               }
+                               else
+                                       isOldEmul = false;
+                               
+                               Thread.sleep(1);
+                               sleepCnt += 1;
+                       }
+                       
+                       if(sdsock.isMounted)
+                       {
+                               cmbRecordFormat.setText(sdsock.currentSDpath);
+                               mntButtonClick();
+                       }
+                       else
+                       {
+                               cmbRecordFormat.select(0);
+                               umntButtonClick();
+                               
+                               if(isOldEmul)
+                                       button_mount.setEnabled(false);
+                       }
+               } catch (InterruptedException e) {
+                       e.printStackTrace();
+               } catch (Exception e) {
+                       // TODO Auto-generated catch block
+                       e.printStackTrace();
+               }
+       }
+       
+       public void mntButtonClick() {
+               button_mount.setEnabled(false);
+               button_umount.setEnabled(true);
+               cmbRecordFormat.setEnabled(false);
+       }
+       
+       public void umntButtonClick() {
+               button_umount.setEnabled(false);
+               button_mount.setEnabled(true);
+               cmbRecordFormat.setEnabled(true);
+       }
+       
+       //@Override
+       public void disconnect() {
+               // TODO Auto-generated method stub
+               SDcardSocket.getInstance().disconnect();
+       }
+       
+       @Override
+       protected void finalize() throws Throwable {
+               InjectorView.getDefault().removeSelectionListener(this);
+               super.finalize();
+       }
+       
+       @Override
+       public void selectionChanged(FileEntry selectedEntry) {
+               if (selectedEntry == null) {
+                       disconnect();
+               } else {
+                       String selectedName = selectedEntry.getDevice().getSerialNumber();
+                       if (currentDevice == null) {
+                               if (selectedName != null) {
+//                                     try {
+                                               connect();
+/*                                     } catch (RuntimeException e) {
+                                               e.printStackTrace();
+                                       } catch (Exception e) {
+                                               // TODO Auto-generated catch block
+                                               e.printStackTrace();
+                                       }*/
+                               }
+                       } else {
+                               if (currentDevice.getSerialNumber() != selectedName) {
+                                       disconnect();
+//                                     try {
+                                               connect();
+/*                                     } catch (RuntimeException e) {
+                                               e.printStackTrace();
+                                       } catch (Exception e) {
+                                               // TODO Auto-generated catch block
+                                               e.printStackTrace();
+                                       }*/
+                               }
+                               else
+                               {
+                                       SDcardSocket sdsock = SDcardSocket.getInstance();
+                                       try {
+                                               sdsock.queryMountStatus();
+                                       } catch (IOException e) {
+                                               e.printStackTrace();
+                                       } catch (Exception e) {
+                                               // TODO Auto-generated catch block
+                                               e.printStackTrace();
+                                       }
+                               }
+                       }
+               }
+       }
+}
@@ -1,11 +1,13 @@
 /*
- * org.tizen.nfc.tag.page
+ * org.tizen.injector.nfc.tag.page
  *
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact:
  * Jihye kim <jihye1128.kim@samsung.com>
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
  * Yeongkyoon Lee <yeongkyoon.lee@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * - S-Core Co., Ltd
  */
 
-package org.tizen.nfc.page;
+package org.tizen.injector.device.sdcard.page;
 
 import java.util.ArrayList;
 
-public class NfcStringResource
+class SdcardStringArray
 {
        private ArrayList<String> list;
        
-       public NfcStringResource()
+       public SdcardStringArray()
        {
                list = new ArrayList<String>();
        }
@@ -53,26 +55,7 @@ public class NfcStringResource
        }
 }
 
-class TagType extends NfcStringResource
-{
-       private static TagType tagtype = new TagType();
-       public static TagType getInstance()
-       {
-               return tagtype;
-       }
-
-       private TagType()
-       {
-               add(0, "");
-               add(1, "Topaz Jewel (Type1)");
-               add(2, "Mifare UL (Type2)");
-               add(3, "Felica (Type3)");
-               add(4, "Mifare Desfire (Type4)");
-       }
-
-}
-
-class RecordFormat extends NfcStringResource
+class RecordFormat extends SdcardStringArray
 {
        private static RecordFormat format = new RecordFormat();
        public static RecordFormat getInstance()
@@ -82,26 +65,9 @@ class RecordFormat extends NfcStringResource
 
        private RecordFormat()
        {
-               //add(0, "NDEF_TNF_EMPTY");
-               add(0, "NDEF_TNF_WELL_KNOWN");
-               add(1, "NDEF_TNF_MIME_MEDIA");
-               add(2, "NDEF_TNF_ABSOLUTE_URI");
-               add(3, "NDEF_TNF_EXTERNAL");
-               //add(5, "NDEF_TNF_UNKNOWN");
-       }
-}
-
-class TypeName extends NfcStringResource
-{
-       private static TypeName typename = new TypeName();
-       public static TypeName getInstance()
-       {
-               return typename;
-       }
-
-       private TypeName()
-       {
-               add(0, "U");
-               add(1, "T");
+               add(0, "sdcard_ext4_4G.img");
+               add(1, "sdcard_ext4_8G.img");
+               add(2, "sdcard_ext4_16G.img");
+               add(3, "sdcard_ext4_32G.img");
        }
 }
\ No newline at end of file
@@ -1,11 +1,12 @@
 /*
- * org.tizen.device.usb
+ * org.tizen.injector.device.usb
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.device.usb;
+package org.tizen.injector.device.usb;
 
+import org.tizen.injector.device.usb.page.UsbPage;
 import org.tizen.injector.provider.AbstractInjectorItem;
-import org.tizen.device.usb.page.UsbPage;
 
 public class Usb extends AbstractInjectorItem{
 
@@ -1,11 +1,12 @@
 /*
- * org.tizen.device.usb
+ * org.tizen.injector.device.usb
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,7 +25,7 @@
  * 
  */
 
-package org.tizen.device.usb.page;
+package org.tizen.injector.device.usb.page;
 
 public class UsbConstants {
        public static final String inject = "Connect";
@@ -1,11 +1,12 @@
 /*
- * org.tizen.device.usb
+ * org.tizen.injector.device.usb
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.device.usb.page;
+package org.tizen.injector.device.usb.page;
 
+import java.io.IOException;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.SWT;
-
-
 import org.tizen.common.connection.ConnectionPlugin;
 import org.tizen.common.connection.ConnectionPlugin.ISelectionListener;
-import org.tizen.sdblib.FileListingService.FileEntry;
-import org.tizen.sdblib.IDevice;
 import org.tizen.injector.protocol.sensor.TestSensorMessage;
 import org.tizen.injector.provider.AbstractInjectorItem;
 import org.tizen.injector.provider.AbstractInjectorPage;
 import org.tizen.injector.view.InjectorView;
+import org.tizen.sdblib.IDevice;
+import org.tizen.sdblib.service.FileEntry;
 
 public class UsbPage extends AbstractInjectorPage implements ISelectionListener {
 
        private Button radioButton[];
        private final String sensorNumber = "10\n";
        private boolean sensorOn;
+       private int preStatus = -1;
        private IDevice currentDevice;
        
        public UsbPage(AbstractInjectorItem item, String name) {
@@ -59,12 +63,36 @@ public class UsbPage extends AbstractInjectorPage implements ISelectionListener
                InjectorView.getDefault().addSelectionListener(this);
                currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
 
-               Composite mainComposite = formUtil.createComposite(parent, 5);
+               //Composite mainComposite = formUtil.createComposite(parent, 1);
+               Composite subComposite = formUtil.createComposite(parent, 5); // for focus when mouse click
+               subComposite.addMouseListener(new MouseListener() {
+                       @Override
+                       public void mouseDoubleClick(MouseEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+                       @Override
+                       public void mouseDown(MouseEvent e) {
+                               // TODO Auto-generated method stub
+                               for( int i = 0 ; i < radioButton.length ; i++ ) {
+                                       if(radioButton[i].getSelection()) {
+                                               if( i == 0 )  // On
+                                                       radioButton[0].setFocus();
+                                               else            // Off
+                                                       radioButton[1].setFocus();
+                                       }
+                               }
+                       }
+                       @Override
+                       public void mouseUp(MouseEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
                radioButton = new Button[2];
-               radioButton[0] = formUtil.createButton(mainComposite, UsbConstants.inject, SWT.RADIO);
-               radioButton[1] = formUtil.createButton(mainComposite, UsbConstants.remove, SWT.RADIO);
+               radioButton[0] = formUtil.createButton(subComposite, UsbConstants.inject, SWT.RADIO);
+               radioButton[1] = formUtil.createButton(subComposite, UsbConstants.remove, SWT.RADIO);
                radioButton[1].setSelection(true);
                sensorOn = false;
+               preStatus = 0;
                /*
                for( int i = 0 ; i < radioButton.length ; i++ ) {
                        if(radioButton[i].getSelection()) {
@@ -117,14 +145,20 @@ public class UsbPage extends AbstractInjectorPage implements ISelectionListener
        }
 
        public void sendMessage(int status) {
+                       if(preStatus == status)
+                               return;
+                       
                        TestSensorMessage msg = new TestSensorMessage(status);
                        try {
                        //      sensorSocket.send(sensorNumber + msg.getMessage());
                                injectorSocket.sendSensor(sensorNumber + msg.getMessage());
+                       } catch (IOException e1) {
+                               e1.printStackTrace();
                        } catch (Exception e1) {
                                // TODO Auto-generated catch block
                                e1.printStackTrace();
                        }
+                       preStatus = status;
        }
 
 //     @Override
@@ -152,23 +186,20 @@ public class UsbPage extends AbstractInjectorPage implements ISelectionListener
 
        @Override
        public void selectionChanged(FileEntry selectedEntry) {
-               if( selectedEntry == null)
-               {
-                       disconnect();
-                       return;
-               }
-               else if (!selectedEntry.getFileListingService().getDevice().isEmulator())
-                       return;
-               
-               if(currentDevice == null && selectedEntry.getName() != null) {
-                       connect();
-               } else if(currentDevice == null && selectedEntry.getName() == null) {
-                       return;
-               } else if (currentDevice.getSerialNumber() != selectedEntry.getName()) {
+               if (selectedEntry == null) {
                        disconnect();
-                       connect();
-               } else if (currentDevice.getSerialNumber() == selectedEntry.getName()) {
-                       return;
+               } else {
+                       String selectedName = selectedEntry.getDevice().getSerialNumber();
+                       if (currentDevice == null) {
+                               if (selectedName != null) {
+                                       connect();
+                               }
+                       } else {
+                               if (currentDevice.getSerialNumber() != selectedName) {
+                                       disconnect();
+                                       connect();
+                               }
+                       }
                }
                if( sensorOn ) // On
                        sendMessage(1);
diff --git a/org.tizen.injector.location.core/.project b/org.tizen.injector.location.core/.project
new file mode 100644 (file)
index 0000000..2369449
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.tizen.injector.location.core</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+       </natures>
+</projectDescription>
diff --git a/org.tizen.injector.location.core/META-INF/MANIFEST.MF b/org.tizen.injector.location.core/META-INF/MANIFEST.MF
new file mode 100644 (file)
index 0000000..2886389
--- /dev/null
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Tizen Event Injector Location Core
+Bundle-SymbolicName: org.tizen.injector.location.core;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: The Linux Foundation
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Export-Package: org.tizen.injector.location.core.injector,
+ org.tizen.injector.location.core.model,
+ org.tizen.injector.location.core.protocol
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.tizen.common,
+ org.tizen.injector,
+ org.tizen.common.connection
+Import-Package: org.tizen.sdblib,
+ org.tizen.sdblib.service
@@ -1,4 +1,4 @@
-#Properties file for org.tizen.location.core
+#Properties file for org.tizen.injector.location.core
 extension-point.name = Location Injector
 Bundle-Vendor = Tizen
 Bundle-Name = Tizen SDK Location Core
@@ -1,34 +1,34 @@
-/*\r
- * org.tizen.location.core\r
- * \r
- * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
- *\r
- * Contact: \r
- * Sungmin Ha <sungmin82.ha@samsung.com>\r
- * YeongKyoon Lee <yeongkyoon.lee@samsung.com>\r
- * DongKyun Yun <dk77.yun@samsung.com>\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * \r
- * Contributors:\r
- * - S-Core Co., Ltd\r
- * \r
- */\r
-\r
-package org.tizen.location.core.injector;\r
-\r
-public class DebugLog {\r
-       public static void log(Object msg) {\r
-               System.out.println(msg);\r
-       }\r
-}\r
+/*
+ * org.tizen.injector.location.core
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.location.core.injector;
+
+public class DebugLog {
+       public static void log(Object msg) {
+               System.out.println(msg);
+       }
+}
@@ -1,12 +1,12 @@
 /*
- * org.tizen.location.core
+ * org.tizen.injector.location.core
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.location.core.injector;
+package org.tizen.injector.location.core.injector;
+
+import static org.tizen.common.util.IOUtil.tryClose;
+import static org.tizen.sdblib.service.SyncServiceConstants.RESULT_OK;
 
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.IOException;
 
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.NullProgressMonitor;
-
 import org.tizen.common.connection.ConnectionPlugin;
 import org.tizen.common.connection.ConnectionPlugin.ISelectionListener;
-import org.tizen.common.model.ITableVO;
-import org.tizen.sdblib.FileListingService.FileEntry;
-import org.tizen.sdblib.IDevice;
-import org.tizen.sdblib.SyncService;
-import org.tizen.sdblib.SyncService.SyncResult;
-//import org.tizen.location.core.injector.DebugLog;
+import org.tizen.injector.location.core.model.GeoLocationVO;
+import org.tizen.injector.location.core.protocol.GeoLocation;
+import org.tizen.injector.model.ITableVO;
+import org.tizen.injector.socket.TelephonySocket;
 import org.tizen.injector.view.InjectorView;
-import org.tizen.location.core.model.GeoLocationVO;
-import org.tizen.location.core.protocol.GeoLocation;
+import org.tizen.sdblib.IDevice;
+import org.tizen.sdblib.service.FileEntry;
+import org.tizen.sdblib.service.SyncResult;
+import org.tizen.sdblib.service.SyncService;
 
 public class LocationInjector implements ISelectionListener {
        private IProgressMonitor monitor;
 
-       private final String remoteFilePath = "/opt/data/gps-manager/replay/nmea_replay.log";
-       private final String setStopMode        = "vconftool set -t int db/location/replay/ReplayMode 0"; // STOP MODE
-       private final String setLogMode         = "vconftool set -t int db/location/replay/ReplayMode 1"; // NMEA MODE(LOG MODE)
-       private final String setManualMode      = "vconftool set -t int db/location/replay/ReplayMode 2"; // MANUAL MODE
+       private final String logFileName = "nmea_replay.log";
+       private final String remoteFilePath = "/opt/media/gps-manager/replay/" + logFileName;
+       //"vconftool set -t string db/location/replay/FileName "nmea_replay.log";
+       private final String SETSTOPMODE        = "0";//"vconftool set -t int db/location/replay/ReplayMode 0"; // STOP MODE
+       private final String SETLOGMODE         = "1";//"vconftool set -t int db/location/replay/ReplayMode 1"; // NMEA MODE(LOG MODE)
+       private final String SETMANUALMODE      = "2";//"vconftool set -t int db/location/replay/ReplayMode 2"; // MANUAL MODE
 
        private boolean isChange = false;
        private GeoLocation location = null;
+       private TelephonySocket injectorSocket = TelephonySocket.getInstance();
 
        public LocationInjector() {
                InjectorView.getDefault().addSelectionListener(this);
@@ -62,28 +68,51 @@ public class LocationInjector implements ISelectionListener {
        }
 
        private void setStopMode() throws IOException {
-               IDevice currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
-               currentDevice.executeShellCommand(setStopMode);
+               try {
+                       injectorSocket.sendLocation(SETSTOPMODE);
+               } catch (IOException e) {
+                       e.printStackTrace();
+                       throw e;
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
        }
 
        private void setLogMode() throws IOException {
-               IDevice currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
-               currentDevice.executeShellCommand(setLogMode);
+               try {
+                       injectorSocket.sendLocation(SETLOGMODE + "," + logFileName);
+               } catch (IOException e) {
+                       e.printStackTrace();
+                       throw e;
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
        }
        
        private void setManualMode() throws IOException {
-               IDevice currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
-               currentDevice.executeShellCommand(setManualMode);
+               try {
+                       injectorSocket.sendLocation(SETMANUALMODE);
+               } catch (IOException e) {
+                       e.printStackTrace();
+                       throw e;
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
        }
 
        private boolean injectLocation(double latitude, double longitude) throws IOException {
-               IDevice currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
-               String latitudeCmd  = String.format("vconftool set -t double db/location/replay/ManualLatitude %f", latitude);
-               String longitudeCmd = String.format("vconftool set -t double db/location/replay/ManualLongitude %f", longitude);
-
-               currentDevice.executeShellCommand(latitudeCmd);
-               currentDevice.executeShellCommand(longitudeCmd);
-
+               String location = SETMANUALMODE + "," + latitude + "," + longitude;
+               //String latitudeCmd  = String.format("vconftool set -t double db/location/replay/ManualLatitude %f", latitude);
+               //String longitudeCmd = String.format("vconftool set -t double db/location/replay/ManualLongitude %f", longitude);
+               try {
+                       injectorSocket.sendLocation(location);
+               } catch (IOException e) {
+                       e.printStackTrace();
+                       throw e;
+               } catch (Exception e) {
+                       e.printStackTrace();
+                       return false;
+               }
                return true;
        }
 
@@ -95,13 +124,22 @@ public class LocationInjector implements ISelectionListener {
                setMonitor(monitor);
 
                // PUSH FILE TO EMULATOR
-               SyncService sync = ConnectionPlugin.getDefault().getCurrentDevice().getSyncService();
+               IDevice device = ConnectionPlugin.getDefault().getCurrentDevice();
+               SyncService sync = device.getSyncService();
                if (sync != null) {
-                       SyncResult result = sync.pushFile(filename.getPath(), remoteFilePath, SyncService.getNullProgressMonitor());
-                   if (result.getCode() != SyncService.RESULT_OK) {
-                       // TODO
-                       return false;
-                   }
+                       FileInputStream fileIn = null;
+                       try
+                       {
+                               fileIn = new FileInputStream( filename.getPath() );
+                               SyncResult result = sync.doPush( fileIn, device.getFileEntry(remoteFilePath), null, -1 );
+                               if (result.getCode() != RESULT_OK) {
+                                       return false;
+                               }
+                       }
+                       finally
+                       {
+                               tryClose( fileIn );
+                       }
                }
 
                // SET LOG MODE
@@ -1,12 +1,12 @@
 /*
- * org.tizen.location.core
+ * org.tizen.injector.location.core
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.location.core.model;
+package org.tizen.injector.location.core.model;
 
-import org.tizen.common.model.AbstractTableVO;
-import org.tizen.location.core.protocol.GeoLocation;
+import org.tizen.injector.location.core.protocol.GeoLocation;
+import org.tizen.injector.model.AbstractTableVO;
 
 public class GeoLocationVO extends AbstractTableVO {
        private int seq;
@@ -1,12 +1,12 @@
 /*
- * org.tizen.location.core
+ * org.tizen.injector.location.core
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@
  * 
  */
 
-package org.tizen.location.core.protocol;
+package org.tizen.injector.location.core.protocol;
 
 import java.util.ArrayList;
 import java.util.Formatter;
-/*\r
- * org.tizen.location.core\r
- * \r
- * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
- *\r
- * Contact: \r
- * Sungmin Ha <sungmin82.ha@samsung.com>\r
- * YeongKyoon Lee <yeongkyoon.lee@samsung.com>\r
- * DongKyun Yun <dk77.yun@samsung.com>\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * \r
- * Contributors:\r
- * - S-Core Co., Ltd\r
- * \r
- */\r
-\r
-package org.tizen.location.core.protocol;\r
-\r
-public class GeoLocation {\r
-       \r
-       public enum Directions {\r
-               NORTH, SOUTH, EAST, WEST\r
-       }\r
-       \r
-       private double latitude;\r
-       private double NMEAlatitude;\r
-       private Directions northSouth;\r
-       private double longitude;\r
-       private double NMEAlongitude;\r
-       private Directions eastWest;\r
-       \r
-       public GeoLocation(double latitude, double longitude) {\r
-               setLatitude(latitude);\r
-               setLongitude(longitude);\r
-       }\r
-       \r
-       public double getLatitude() {\r
-               return this.latitude;\r
-       }\r
-       \r
-       public double getLongitude() {\r
-               return this.longitude;\r
-       }\r
-       \r
-       public String getNorthSouth() {\r
-               return northSouth == Directions.NORTH ? "N" : "S"; //$NON-NLS-1$ //$NON-NLS-2$\r
-       }\r
-\r
-       public String getEastWest() {\r
-               return eastWest == Directions.EAST ? "E" : "W"; //$NON-NLS-1$ //$NON-NLS-2$\r
-       }\r
-\r
-       public double getNMEAlatitude() {\r
-               return NMEAlatitude;\r
-       }\r
-\r
-       public double getNMEAlongitude() {\r
-               return NMEAlongitude;\r
-       }\r
-\r
-       public void setLatitude(double latitude) {\r
-               this.latitude = latitude;\r
-               \r
-               if (latitude < 0) {\r
-                       setNorthSouth(Directions.SOUTH);\r
-               } else {\r
-                       setNorthSouth(Directions.NORTH);\r
-               }\r
-               setNMEAlatitude(Math.abs(latitude));\r
-       }\r
-\r
-       public void setLongitude(double longitude) {\r
-               this.longitude = longitude;\r
-               \r
-               if (longitude < 0) {\r
-                       setEastWest(Directions.WEST);\r
-               } else {\r
-                       setEastWest(Directions.EAST);\r
-               }\r
-               setNMEAlongitude(Math.abs(longitude));\r
-       }\r
-       \r
-       private void setNorthSouth(Directions northSouth) {\r
-               this.northSouth = northSouth;\r
-       }\r
-\r
-       private void setEastWest(Directions eastWest) {\r
-               this.eastWest = eastWest;\r
-       }\r
-\r
-       private void setNMEAlatitude(double latitude) {\r
-               int degree = (int) latitude;\r
-               double minutes = (double) ((latitude - degree) * 60);\r
-               \r
-               this.NMEAlatitude = (double) ((degree * 100) + minutes);\r
-       }\r
-\r
-       private void setNMEAlongitude(double longitude) {\r
-               int degree = (int) longitude;\r
-               double minutes = (double) ((longitude - degree) * 60);\r
-               \r
-               this.NMEAlongitude = (double) ((degree * 100) + minutes);\r
-       }\r
-}\r
+/*
+ * org.tizen.injector.location.core
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.location.core.protocol;
+
+public class GeoLocation {
+       
+       public enum Directions {
+               NORTH, SOUTH, EAST, WEST
+       }
+       
+       private double latitude;
+       private double NMEAlatitude;
+       private Directions northSouth;
+       private double longitude;
+       private double NMEAlongitude;
+       private Directions eastWest;
+       
+       public GeoLocation(double latitude, double longitude) {
+               setLatitude(latitude);
+               setLongitude(longitude);
+       }
+       
+       public double getLatitude() {
+               return this.latitude;
+       }
+       
+       public double getLongitude() {
+               return this.longitude;
+       }
+       
+       public String getNorthSouth() {
+               return northSouth == Directions.NORTH ? "N" : "S"; //$NON-NLS-1$ //$NON-NLS-2$
+       }
+
+       public String getEastWest() {
+               return eastWest == Directions.EAST ? "E" : "W"; //$NON-NLS-1$ //$NON-NLS-2$
+       }
+
+       public double getNMEAlatitude() {
+               return NMEAlatitude;
+       }
+
+       public double getNMEAlongitude() {
+               return NMEAlongitude;
+       }
+
+       public void setLatitude(double latitude) {
+               this.latitude = latitude;
+               
+               if (latitude < 0) {
+                       setNorthSouth(Directions.SOUTH);
+               } else {
+                       setNorthSouth(Directions.NORTH);
+               }
+               setNMEAlatitude(Math.abs(latitude));
+       }
+
+       public void setLongitude(double longitude) {
+               this.longitude = longitude;
+               
+               if (longitude < 0) {
+                       setEastWest(Directions.WEST);
+               } else {
+                       setEastWest(Directions.EAST);
+               }
+               setNMEAlongitude(Math.abs(longitude));
+       }
+       
+       private void setNorthSouth(Directions northSouth) {
+               this.northSouth = northSouth;
+       }
+
+       private void setEastWest(Directions eastWest) {
+               this.eastWest = eastWest;
+       }
+
+       private void setNMEAlatitude(double latitude) {
+               int degree = (int) latitude;
+               double minutes = (double) ((latitude - degree) * 60);
+               
+               this.NMEAlatitude = (double) ((degree * 100) + minutes);
+       }
+
+       private void setNMEAlongitude(double longitude) {
+               int degree = (int) longitude;
+               double minutes = (double) ((longitude - degree) * 60);
+               
+               this.NMEAlongitude = (double) ((degree * 100) + minutes);
+       }
+}
@@ -1,12 +1,12 @@
 /*
- * org.tizen.location.core
+ * org.tizen.injector.location.core
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@
  * 
  */
 
-package org.tizen.location.core.protocol;
+package org.tizen.injector.location.core.protocol;
 
 public class IdentifiersConstants {
        
@@ -1,12 +1,12 @@
 /*
- * org.tizen.location.core
+ * org.tizen.injector.location.core
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.location.core.protocol;
+package org.tizen.injector.location.core.protocol;
 
 import org.eclipse.osgi.util.NLS;
 
 public class Messages extends NLS {
-       private static final String BUNDLE_NAME = "org.tizen.location.core.protocol.messages"; //$NON-NLS-1$
+       private static final String BUNDLE_NAME = "org.tizen.injector.location.core.protocol.messages"; //$NON-NLS-1$
        public static String SatelliteInfo_0;
        static {
                // initialize resource bundle
@@ -1,12 +1,12 @@
 /*
- * org.tizen.location.core
+ * org.tizen.injector.location.core
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@
  * 
  */
 
-package org.tizen.location.core.protocol;
+package org.tizen.injector.location.core.protocol;
 
 import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
@@ -1,12 +1,12 @@
 /*
- * org.tizen.location.core
+ * org.tizen.injector.location.core
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@
  * 
  */
 
-package org.tizen.location.core.protocol;
+package org.tizen.injector.location.core.protocol;
 
 import java.text.DecimalFormat;
 
@@ -1,12 +1,12 @@
 /*
- * org.tizen.location.core
+ * org.tizen.injector.location.core
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@
  * 
  */
 
-package org.tizen.location.core.protocol;
+package org.tizen.injector.location.core.protocol;
 
 import java.text.DecimalFormat;
 import java.util.ArrayList;
@@ -1,12 +1,12 @@
 /*
- * org.tizen.location.core
+ * org.tizen.injector.location.core
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@
  * 
  */
 
-package org.tizen.location.core.protocol;
+package org.tizen.injector.location.core.protocol;
 
 import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
@@ -1,12 +1,12 @@
 /*
- * org.tizen.location.core
+ * org.tizen.injector.location.core
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@
  * 
  */
 
-package org.tizen.location.core.protocol;
+package org.tizen.injector.location.core.protocol;
 
 import javax.management.RuntimeErrorException;
 
similarity index 93%
rename from org.tizen.location.log/.project
rename to org.tizen.injector.location.log/.project
index e673a10..f6ef1bd 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
-       <name>org.tizen.location.log</name>
+       <name>org.tizen.injector.location.log</name>
        <comment></comment>
        <projects>
        </projects>
@@ -1,14 +1,14 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Tizen Event Injector Location Log
-Bundle-SymbolicName: org.tizen.location.log;singleton:=true
+Bundle-SymbolicName: org.tizen.injector.location.log;singleton:=true
 Bundle-Version: 1.0.0.qualifier
-Bundle-Vendor: Samsung
+Bundle-Vendor: The Linux Foundation
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
  org.eclipse.ui.forms;bundle-version="3.3.103",
  org.tizen.common,
  org.tizen.injector,
- org.tizen.location.core
+ org.tizen.injector.location.core
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/org.tizen.injector.location.log/OSGI-INF/l10n/bundle.properties b/org.tizen.injector.location.log/OSGI-INF/l10n/bundle.properties
new file mode 100644 (file)
index 0000000..33d3316
--- /dev/null
@@ -0,0 +1,4 @@
+#Properties file for org.tizen.injector.location.log
+Bundle-Vendor = Tizen
+Bundle-Name = Tizen SDK Location Log
+Log = Log
\ No newline at end of file
similarity index 96%
rename from org.tizen.location.map/build.properties
rename to org.tizen.injector.location.log/build.properties
index f9eefdc..439377d 100644 (file)
@@ -1,8 +1,8 @@
-source.. = src/\r
-output.. = bin/\r
-bin.includes = plugin.xml,\\r
-               META-INF/,\\r
-               .,\\r
-               OSGI-INF/l10n/bundle.properties\r
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+               META-INF/,\
+               .,\
+               OSGI-INF/l10n/bundle.properties
 javacSource = 1.6
 javacTarget = 1.6
similarity index 71%
rename from org.tizen.location.log/plugin.xml
rename to org.tizen.injector.location.log/plugin.xml
index 1e04e25..aa3df35 100644 (file)
@@ -1,13 +1,13 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<?eclipse version="3.2"?>\r
-<plugin>\r
-   <extension\r
-         point="org.tizen.injector.injectorItemProvider">\r
-      <itemType\r
-            category="Location"\r
-            class="org.tizen.location.log.Log"\r
-            id="org.tizen.location.log"\r
-            name="%Log">\r
-      </itemType>\r
-   </extension>\r
-</plugin>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+   <extension
+         point="org.tizen.injector.injectorItemProvider">
+      <itemType
+            category="Location"
+            class="org.tizen.injector.location.log.Log"
+            id="org.tizen.injector.location.log"
+            name="%Log">
+      </itemType>
+   </extension>
+</plugin>
@@ -1,12 +1,12 @@
 /*
- * org.tizen.location.log
+ * org.tizen.injector.location.log
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.location.log;
+package org.tizen.injector.location.log;
 
 import java.util.ArrayList;
 
-import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.forms.widgets.Section;
 
+import org.tizen.injector.location.log.page.LogFile;
 import org.tizen.injector.provider.AbstractInjectorItem;
-import org.tizen.location.log.page.LogFile;
 
 public class Log extends AbstractInjectorItem {
        private static String LABEL = Messages.Log_0;
@@ -44,9 +43,9 @@ public class Log extends AbstractInjectorItem {
        }
        
        public void setSiblingsEnabled(boolean enabled) {
-               ArrayList<Composite> list = getCategoryItems("Location"); //$NON-NLS-1$
+               ArrayList<AbstractInjectorItem> list = getCategoryItems("Location"); //$NON-NLS-1$
                for (int i = 0; i < list.size(); i++) {
-                       Section parent = (Section) list.get(i).getParent();
+                       Section parent = (Section) list.get(i).getParent().getParent();
                        if (!parent.getText().equals(LABEL)) {
                                if(!enabled) {
                                        parent.setExpanded(enabled);
@@ -1,12 +1,12 @@
 /*
- * org.tizen.location.log
+ * org.tizen.injector.location.log
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.location.log;
+package org.tizen.injector.location.log;
 
 import org.eclipse.osgi.util.NLS;
 
 public class Messages extends NLS {
-       private static final String BUNDLE_NAME = "org.tizen.location.log.messages"; //$NON-NLS-1$
+       private static final String BUNDLE_NAME = "org.tizen.injector.location.log.messages"; //$NON-NLS-1$
        public static String Log_0;
        public static String Log_1;
        static {
@@ -1,12 +1,12 @@
 /*
- * org.tizen.location.log
+ * org.tizen.injector.location.log
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@
  * 
  */
 
-package org.tizen.location.log.page;
+package org.tizen.injector.location.log.page;
 
 import java.io.BufferedReader;
 import java.io.File;
@@ -51,11 +51,11 @@ import org.eclipse.swt.widgets.Text;
 //import org.eclipse.ui.IWorkbenchWindow;
 //import org.eclipse.ui.PlatformUI;
 
+import org.tizen.injector.location.core.injector.LocationInjector;
+import org.tizen.injector.location.log.Log;
 import org.tizen.injector.provider.AbstractInjectorItem;
 import org.tizen.injector.provider.AbstractInjectorPage;
-//import org.tizen.location.core.injector.AbstractLocationInjector;
-import org.tizen.location.core.injector.LocationInjector;
-import org.tizen.location.log.Log;
+//import org.tizen.injector.location.core.injector.AbstractLocationInjector;
 
 public class LogFile extends AbstractInjectorPage {
        
@@ -168,7 +168,7 @@ public class LogFile extends AbstractInjectorPage {
                                        });
                                        injectJob.schedule();
                                } else {
-                                       // Exception Error
+                                       System.out.println("file is not exist");
                                }
                        }
                        
@@ -1,12 +1,12 @@
 /*
- * org.tizen.location.log
+ * org.tizen.injector.location.log
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.location.log.page;
+package org.tizen.injector.location.log.page;
 
 import org.eclipse.osgi.util.NLS;
 
 public class Messages extends NLS {
-       private static final String BUNDLE_NAME = "org.tizen.location.log.page.messages"; //$NON-NLS-1$
+       private static final String BUNDLE_NAME = "org.tizen.injector.location.log.page.messages"; //$NON-NLS-1$
        public static String LogFile_2;
        public static String LogFile_4;
        public static String LogFile_6;
diff --git a/org.tizen.injector.location.manual/.project b/org.tizen.injector.location.manual/.project
new file mode 100644 (file)
index 0000000..d98deba
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.tizen.injector.location.manual</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+       </natures>
+</projectDescription>
@@ -1,14 +1,14 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Tizen Event Injector Location Manual
-Bundle-SymbolicName: org.tizen.location.manual;singleton:=true
+Bundle-SymbolicName: org.tizen.injector.location.manual;singleton:=true
 Bundle-Version: 1.0.0.qualifier
-Bundle-Vendor: Samsung
+Bundle-Vendor: The Linux Foundation
 Require-Bundle: org.eclipse.ui,
  org.eclipse.ui.forms,
  org.eclipse.core.runtime,
  org.tizen.common,
  org.tizen.injector,
- org.tizen.location.core
+ org.tizen.injector.location.core
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/org.tizen.injector.location.manual/OSGI-INF/l10n/bundle.properties b/org.tizen.injector.location.manual/OSGI-INF/l10n/bundle.properties
new file mode 100644 (file)
index 0000000..0b17701
--- /dev/null
@@ -0,0 +1,4 @@
+#Properties file for org.tizen.injector.location.manual
+Bundle-Vendor = Tizen
+Bundle-Name = Tizen SDK Location Manual
+Manual = Manual
\ No newline at end of file
@@ -1,9 +1,9 @@
-source.. = src/\r
-output.. = bin/\r
-bin.includes = plugin.xml,\\r
-               META-INF/,\\r
-               .,\\r
-               build.properties,\\r
-               OSGI-INF/l10n/bundle.properties\r
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+               META-INF/,\
+               .,\
+               build.properties,\
+               OSGI-INF/l10n/bundle.properties
 javacSource = 1.6
 javacTarget = 1.6
similarity index 70%
rename from org.tizen.location.manual/plugin.xml
rename to org.tizen.injector.location.manual/plugin.xml
index b795162..93fd85e 100644 (file)
@@ -1,13 +1,13 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<?eclipse version="3.2"?>\r
-<plugin>\r
-   <extension\r
-         point="org.tizen.injector.injectorItemProvider">\r
-      <itemType\r
-            category="Location"\r
-            class="org.tizen.location.manual.Manual"\r
-            id="org.tizen.location.manual"\r
-            name="%Manual">\r
-      </itemType>\r
-   </extension>\r
-</plugin>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+   <extension
+         point="org.tizen.injector.injectorItemProvider">
+      <itemType
+            category="Location"
+            class="org.tizen.injector.location.manual.Manual"
+            id="org.tizen.injector.location.manual"
+            name="%Manual">
+      </itemType>
+   </extension>
+</plugin>
@@ -1,12 +1,12 @@
 /*
- * org.tizen.location.manual
+ * org.tizen.injector.location.manual
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.location.manual;
+package org.tizen.injector.location.manual;
 
 import java.util.ArrayList;
 
-import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.forms.widgets.Section;
 
+import org.tizen.injector.location.manual.page.Coordinate;
 import org.tizen.injector.provider.AbstractInjectorItem;
-import org.tizen.location.manual.page.Coordinate;
 
 public class Manual extends AbstractInjectorItem {
        private static String LABEL = Messages.Manual_0; 
@@ -44,9 +43,9 @@ public class Manual extends AbstractInjectorItem {
        }
        
        public void setSiblingsEnabled(boolean enabled) {
-               ArrayList<Composite> list = getCategoryItems("Location"); //$NON-NLS-1$
+               ArrayList<AbstractInjectorItem> list = getCategoryItems("Location"); //$NON-NLS-1$
                for (int i = 0; i < list.size(); i++) {
-                       Section parent = (Section) list.get(i).getParent();
+                       Section parent = (Section) list.get(i).getParent().getParent();
                        if (!parent.getText().equals(LABEL)) {
                                if(!enabled) {
                                        parent.setExpanded(enabled);
@@ -1,12 +1,12 @@
 /*
- * org.tizen.location.manual
+ * org.tizen.injector.location.manual
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.location.manual;
+package org.tizen.injector.location.manual;
 
 import org.eclipse.osgi.util.NLS;
 
 public class Messages extends NLS {
-       private static final String BUNDLE_NAME = "org.tizen.location.manual.messages"; //$NON-NLS-1$
+       private static final String BUNDLE_NAME = "org.tizen.injector.location.manual.messages"; //$NON-NLS-1$
        public static String Manual_0;
        public static String Manual_1;
        static {
@@ -1,12 +1,12 @@
 /*
- * org.tizen.location.manual
+ * org.tizen.injector.location.manual
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@
  * 
  */
 
-package org.tizen.location.manual.page;
+package org.tizen.injector.location.manual.page;
 
 import java.io.IOException;
 
@@ -48,17 +48,17 @@ import org.eclipse.swt.widgets.Text;
 //import org.eclipse.ui.IWorkbenchWindow;
 //import org.eclipse.ui.PlatformUI;
 
+import org.tizen.injector.location.core.injector.LocationInjector;
+import org.tizen.injector.location.core.protocol.GeoLocation;
+import org.tizen.injector.location.manual.Manual;
 import org.tizen.injector.provider.AbstractInjectorItem;
 import org.tizen.injector.provider.AbstractInjectorPage;
-//import org.tizen.location.core.injector.AbstractLocationInjector;
-import org.tizen.location.core.injector.LocationInjector;
-import org.tizen.location.core.protocol.GeoLocation;
-//import org.tizen.location.core.protocol.AbstractNMEA0183;
-//import org.tizen.location.core.protocol.NMEA0183_GPGGA;
-//import org.tizen.location.core.protocol.NMEA0183_GPGSA;
-//import org.tizen.location.core.protocol.NMEA0183_GPGSV;
-//import org.tizen.location.core.protocol.NMEA0183_GPRMC;
-import org.tizen.location.manual.Manual;
+//import org.tizen.injector.location.core.injector.AbstractLocationInjector;
+//import org.tizen.injector.location.core.protocol.AbstractNMEA0183;
+//import org.tizen.injector.location.core.protocol.NMEA0183_GPGGA;
+//import org.tizen.injector.location.core.protocol.NMEA0183_GPGSA;
+//import org.tizen.injector.location.core.protocol.NMEA0183_GPGSV;
+//import org.tizen.injector.location.core.protocol.NMEA0183_GPRMC;
 
 public class Coordinate extends AbstractInjectorPage {
        
@@ -1,12 +1,12 @@
 /*
- * org.tizen.location.manual
+ * org.tizen.injector.location.manual
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.location.manual.page;
+package org.tizen.injector.location.manual.page;
 
 import org.eclipse.osgi.util.NLS;
 
 public class Messages extends NLS {
-       private static final String BUNDLE_NAME = "org.tizen.location.manual.page.messages"; //$NON-NLS-1$
+       private static final String BUNDLE_NAME = "org.tizen.injector.location.manual.page.messages"; //$NON-NLS-1$
        public static String Coordinate_0;
        public static String Coordinate_2;
        public static String Coordinate_4;
similarity index 93%
rename from org.tizen.location.manual/.project
rename to org.tizen.injector.location.map/.project
index cbb210f..ecbaa95 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
-       <name>org.tizen.location.manual</name>
+       <name>org.tizen.injector.location.map</name>
        <comment></comment>
        <projects>
        </projects>
@@ -1,15 +1,15 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Tizen Event Injector Location Map
-Bundle-SymbolicName: org.tizen.location.map;singleton:=true
+Bundle-SymbolicName: org.tizen.injector.location.map;singleton:=true
 Bundle-Version: 1.0.0.qualifier
-Bundle-Vendor: Samsung
+Bundle-Vendor: The Linux Foundation
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
  org.eclipse.core.net;bundle-version="1.2.1",
  org.eclipse.ui.forms;bundle-version="3.3.103",
  org.tizen.common,
  org.tizen.injector,
- org.tizen.location.core
+ org.tizen.injector.location.core
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/org.tizen.injector.location.map/OSGI-INF/l10n/bundle.properties b/org.tizen.injector.location.map/OSGI-INF/l10n/bundle.properties
new file mode 100644 (file)
index 0000000..a1d42ee
--- /dev/null
@@ -0,0 +1,4 @@
+#Properties file for org.tizen.injector.location.map
+Bundle-Vendor = Tizen
+Bundle-Name = Tizen SDK Location Map
+Map = Map
\ No newline at end of file
similarity index 96%
rename from org.tizen.location.log/build.properties
rename to org.tizen.injector.location.map/build.properties
index f9eefdc..439377d 100644 (file)
@@ -1,8 +1,8 @@
-source.. = src/\r
-output.. = bin/\r
-bin.includes = plugin.xml,\\r
-               META-INF/,\\r
-               .,\\r
-               OSGI-INF/l10n/bundle.properties\r
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+               META-INF/,\
+               .,\
+               OSGI-INF/l10n/bundle.properties
 javacSource = 1.6
 javacTarget = 1.6
similarity index 71%
rename from org.tizen.location.map/plugin.xml
rename to org.tizen.injector.location.map/plugin.xml
index b52fd04..719afd1 100644 (file)
@@ -1,13 +1,13 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<?eclipse version="3.2"?>\r
-<plugin>\r
-   <extension\r
-         point="org.tizen.injector.injectorItemProvider">\r
-      <itemType\r
-            category="Location"\r
-            class="org.tizen.location.map.Map"\r
-            id="org.tizen.location.map"\r
-            name="%Map">\r
-      </itemType>\r
-   </extension>\r
-</plugin>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+   <extension
+         point="org.tizen.injector.injectorItemProvider">
+      <itemType
+            category="Location"
+            class="org.tizen.injector.location.map.Map"
+            id="org.tizen.injector.location.map"
+            name="%Map">
+      </itemType>
+   </extension>
+</plugin>
@@ -1,12 +1,12 @@
 /*
- * org.tizen.location.map
+ * org.tizen.injector.location.map
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.location.map;
+package org.tizen.injector.location.map;
 
 import java.util.ArrayList;
 
-import org.eclipse.core.internal.net.ProxyManager;
-import org.eclipse.core.net.proxy.IProxyData;
-import org.eclipse.core.net.proxy.IProxyService;
+//import org.eclipse.core.internal.net.ProxyManager;
+//import org.eclipse.core.net.proxy.IProxyData;
+//import org.eclipse.core.net.proxy.IProxyService;
 import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.swt.widgets.Composite;
 import org.eclipse.ui.forms.widgets.Section;
 
-import org.tizen.common.model.DefaultTableModel;
+import org.tizen.injector.location.core.model.GeoLocationVO;
+import org.tizen.injector.location.map.page.MapImage;
+import org.tizen.injector.model.DefaultTableModel;
 import org.tizen.injector.provider.AbstractInjectorItem;
-//import org.tizen.location.core.injector.DebugLog;
-import org.tizen.location.core.model.GeoLocationVO;
-import org.tizen.location.map.page.MapImage;
+import org.tizen.injector.provider.AbstractInjectorPage;
+//import org.tizen.injector.location.core.injector.DebugLog;
 
-@SuppressWarnings("restriction")
+//@SuppressWarnings("restriction")
 public class Map extends AbstractInjectorItem {
        private static String LABEL = Messages.Map_0;
        
        private DefaultTableModel model = new DefaultTableModel(new GeoLocationVO());
        private ArrayList<TableViewer> viewerList = new ArrayList<TableViewer>();
-       public static String host = null;
-       public static int port = -1;
+       //public static String host = null;
+       //public static int port = -1;
        @Override
        protected void addPages() {
-               init();
+               //init();
                addPage(new MapImage(this, Messages.Map_1, model));
        }
-       
+
+       public void initializeContents() {
+               for (AbstractInjectorPage page : getPageList()) {
+                       page.initializeContents();
+               }
+       }
+       /*
        private void init() {   
                // Get Preferences - General - Network Connections
                IProxyService proxyManager = ProxyManager.getProxyManager();
@@ -85,7 +91,7 @@ public class Map extends AbstractInjectorItem {
 //             DebugLog.log("[Activator] proxy initiate...." + System.getProperty("network.proxy_host") + " : " + //$NON-NLS-3$
 //                             System.getProperty("network.proxy_port")); //$NON-NLS-1$
        }
-       
+       */
        public void addViewer(TableViewer viewer){
                viewerList.add(viewer);
        }
@@ -97,9 +103,9 @@ public class Map extends AbstractInjectorItem {
        }
        
        public void setSiblingsEnabled(boolean enabled) {
-               ArrayList<Composite> list = getCategoryItems("Location"); //$NON-NLS-1$
+               ArrayList<AbstractInjectorItem> list = getCategoryItems("Location"); //$NON-NLS-1$
                for (int i = 0; i < list.size(); i++) {
-                       Section parent = (Section) list.get(i).getParent();
+                       Section parent = (Section) list.get(i).getParent().getParent();
                        if (!parent.getText().equals(LABEL)) {
                                if(!enabled) {
                                        parent.setExpanded(enabled);
@@ -1,12 +1,12 @@
 /*
- * org.tizen.location.map
+ * org.tizen.injector.location.map
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.location.map;
+package org.tizen.injector.location.map;
 
 import org.eclipse.osgi.util.NLS;
 
 public class Messages extends NLS {
-       private static final String BUNDLE_NAME = "org.tizen.location.map.messages"; //$NON-NLS-1$
+       private static final String BUNDLE_NAME = "org.tizen.injector.location.map.messages"; //$NON-NLS-1$
        public static String Map_0;
        public static String Map_1;
        static {
diff --git a/org.tizen.injector.location.map/src/org/tizen/injector/location/map/page/CheckNetThread.java b/org.tizen.injector.location.map/src/org/tizen/injector/location/map/page/CheckNetThread.java
new file mode 100644 (file)
index 0000000..bb9a0b1
--- /dev/null
@@ -0,0 +1,119 @@
+/*
+ * org.tizen.injector.location.map
+ *
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * jihye kim <jihye1128.kim@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.injector.location.map.page;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.UnknownHostException;
+
+public class CheckNetThread extends Thread {
+       private boolean isError = true;
+       private String errorMsg = "<html><head></head><body bgcolor=#dcdcdc oncontextmenu='return false'><br><br><br><br>" +
+                       "<center>Failed to load the map (throw time out ...)<br>Please check the network status!</center></body></html>";;
+
+       private boolean checkGoogle() {
+               try {
+                       //make a URL to a known source
+                       URL url = new URL("http://www.google.com/");
+
+                       //open a connection to that source
+                       HttpURLConnection urlConnect = (HttpURLConnection)url.openConnection();
+                       //trying to retrieve data from the source. If there
+                       //is no connection, this line will fail
+                       urlConnect.connect();
+                       boolean isLoading = false;
+                       if (urlConnect.getResponseCode() != -1) {
+                               // parsing title
+                               BufferedReader in = new BufferedReader (new InputStreamReader(urlConnect.getInputStream()));
+                               String line;
+                               String pre = "<title>";
+                               String tail = "</title>";
+
+                               boolean isNextLine = false;
+                               while((line = in.readLine()) != null) {
+                                       if (line.contains(pre) || isNextLine) {
+                                               if (line.contains("google")) {
+                                                       isLoading = true;
+                                               }
+                                               if (!isLoading && !line.contains(tail)) {
+                                                       isNextLine = true;
+                                                       continue;
+                                               }
+                                               break;
+                                       }
+                               }
+                               in.close();
+                       }
+
+                       if (!isLoading) {
+                               errorMsg = "<html><head></head><body bgcolor=#dcdcdc oncontextmenu='return false'><br><br><br><br>" +
+                                                                       "<center>Failed to load the map.<br>Please check the network status!</center></body></html>";
+                               return false;
+                       }
+                       urlConnect.disconnect();
+               } catch (UnknownHostException e) {
+                       // TODO Auto-generated catch block
+                       //e.printStackTrace();
+                       errorMsg = "<html><head></head><body bgcolor=#dcdcdc oncontextmenu='return false'><br><br><br><br><center>Can't connect to network.</center></body></html>";
+                       return false;
+               }
+               catch (IOException e) {
+                       // TODO Auto-generated catch block
+                       //e.printStackTrace();
+                       errorMsg = "<html><head></head><body bgcolor=#dcdcdc oncontextmenu='return false'><br><br><br><br>" +
+                                       "<center>Failed to load the map.<br>" + e.getMessage() +
+                                       "</center></body></html>";
+                       return false;
+               }
+
+               return true;
+       }
+
+       public void run() {
+               if (!checkGoogle()) {
+                       isError = true;
+               } else {
+                       isError = false;
+               }
+               synchronized(this) {
+                       notifyAll();
+               }
+       }
+
+       public boolean isError() {
+               return isError;
+       }
+
+       public String getErrorMsg() {
+               return errorMsg;
+       }
+}
diff --git a/org.tizen.injector.location.map/src/org/tizen/injector/location/map/page/DebugLog.java b/org.tizen.injector.location.map/src/org/tizen/injector/location/map/page/DebugLog.java
new file mode 100644 (file)
index 0000000..8a49cb4
--- /dev/null
@@ -0,0 +1,128 @@
+/*
+ * org.tizen.injector.location.map
+ *
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * jihye kim <jihye1128.kim@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.injector.location.map.page;
+
+import java.util.Calendar;
+//import java.util.logging.FileHandler;
+import java.util.logging.Formatter;
+//import java.util.logging.Handler;
+//import java.util.logging.Level;
+import java.util.logging.LogRecord;
+//import java.util.logging.Logger;
+
+public class DebugLog {
+       //private static final String LOG_FILE_NAME = "injector.log";
+       //private static Logger logger;
+
+       static {
+               synchronized(DebugLog.class) {
+                       System.out.println("This is empty synchronized phase.");
+               }
+       }
+
+       /*
+       private static void init() {
+               logger = Logger.getLogger("Event Injector");
+               logger.setUseParentHandlers(false);
+               //File logFolder;
+               Handler logFileHandler;
+               try {
+
+                       //logFolder = new File(FilePath.getInstance().getTizenVmsArchPath());
+                       //if (!logFolder.exists()) {
+                       //      logFolder.mkdirs();
+                       //}
+
+                       //logFileHandler = new FileHandler(logFolder.getAbsolutePath() + File.separator + LOG_FILE_NAME);
+                       logFileHandler = new FileHandler(LOG_FILE_NAME);
+
+                       logger.setLevel(Level.ALL);
+                       logFileHandler.setLevel(Level.INFO);
+
+                       logFileHandler.setFormatter(new LoggerFormatter());
+                       logger.addHandler(logFileHandler);
+               } catch (Exception e) {
+                       logger.setLevel(Level.OFF);
+                       e.getMessage();
+               }
+       }
+       */
+
+       public static void log(String msg) {
+               //logger.info(msg);
+               //System.out.println("[INJECTOR] " + msg);
+       }
+}
+
+class LoggerFormatter extends Formatter {
+    public String format(LogRecord record) {
+        StringBuffer sb = new StringBuffer();
+        Calendar cal = Calendar.getInstance();
+        cal.setTimeInMillis(record.getMillis());
+
+        // [YYYY.MM.DD HH:MM:SS][LEVEL][CLASS.METHOD] MESSAGE
+        sb.append('[');
+        sb.append(cal.get(Calendar.YEAR));
+        sb.append('.');
+        sb.append(cal.get(Calendar.MONTH));
+        sb.append('.');
+        sb.append(cal.get(Calendar.DAY_OF_MONTH));
+        sb.append(' ');
+        sb.append(cal.get(Calendar.HOUR_OF_DAY));
+        sb.append(':');
+        sb.append(cal.get(Calendar.MINUTE));
+        sb.append(':');
+        sb.append(cal.get(Calendar.SECOND));
+        sb.append(']');
+        sb.append('[');
+        sb.append(record.getLevel());
+        sb.append(']');
+        sb.append('[');
+        sb.append(record.getSourceClassName().substring(record.getSourceClassName().lastIndexOf(".") + 1));
+        sb.append('.');
+        sb.append(record.getSourceMethodName());
+        sb.append("] ");
+        sb.append(record.getMessage());
+
+        // in case when called Logger.throwing()
+        Throwable t = record.getThrown();
+        if (t != null) {
+            StackTraceElement[] stacks = t.getStackTrace();
+            sb.append('\n');
+            sb.append(t.toString());
+            for (int i = 0; i < stacks.length; i++) {
+                sb.append('\n');
+                sb.append(stacks[i].toString());
+            }
+        }
+        sb.append('\n');
+        return sb.toString();
+    }
+}
+
@@ -1,12 +1,12 @@
 /*
- * org.tizen.location.map
+ * org.tizen.injector.location.map
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.location.map.page;
+package org.tizen.injector.location.map.page;
 
-import java.io.BufferedReader;
 import java.io.IOException;
-import java.io.InputStreamReader;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.net.UnknownHostException;
+import java.net.InetSocketAddress;
+import java.net.Proxy;
+import java.net.ProxySelector;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.List;
 //import java.util.ArrayList;
 //import java.util.List;
 
@@ -59,23 +60,23 @@ import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.PlatformUI;
 
-import org.tizen.common.control.TableViewContentProvider;
-import org.tizen.common.control.TableViewLabelProvider;
-import org.tizen.common.model.DefaultTableModel;
-import org.tizen.common.model.ITableVO;
+import org.tizen.injector.control.TableViewContentProvider;
+import org.tizen.injector.control.TableViewLabelProvider;
+import org.tizen.injector.location.core.injector.LocationInjector;
+import org.tizen.injector.location.core.model.GeoLocationVO;
+import org.tizen.injector.location.core.protocol.GeoLocation;
+import org.tizen.injector.location.map.Map;
+import org.tizen.injector.model.DefaultTableModel;
+import org.tizen.injector.model.ITableVO;
 import org.tizen.injector.provider.AbstractInjectorItem;
 import org.tizen.injector.provider.AbstractInjectorPage;
-//import org.tizen.location.core.injector.AbstractLocationInjector;
-import org.tizen.location.core.injector.DebugLog;
-import org.tizen.location.core.injector.LocationInjector;
-import org.tizen.location.core.model.GeoLocationVO;
-import org.tizen.location.core.protocol.GeoLocation;
-//import org.tizen.location.core.protocol.AbstractNMEA0183;
-//import org.tizen.location.core.protocol.NMEA0183_GPGGA;
-//import org.tizen.location.core.protocol.NMEA0183_GPGSA;
-//import org.tizen.location.core.protocol.NMEA0183_GPGSV;
-//import org.tizen.location.core.protocol.NMEA0183_GPRMC;
-import org.tizen.location.map.Map;
+//import org.tizen.injector.location.core.injector.AbstractLocationInjector;
+//import org.tizen.injector.location.core.injector.DebugLog;
+//import org.tizen.injector.location.core.protocol.AbstractNMEA0183;
+//import org.tizen.injector.location.core.protocol.NMEA0183_GPGGA;
+//import org.tizen.injector.location.core.protocol.NMEA0183_GPGSA;
+//import org.tizen.injector.location.core.protocol.NMEA0183_GPGSV;
+//import org.tizen.injector.location.core.protocol.NMEA0183_GPRMC;
 
 public class MapImage extends AbstractInjectorPage {
 
@@ -86,6 +87,7 @@ public class MapImage extends AbstractInjectorPage {
        private Button injectButton;
        private Button resetButton;
        private Button cancelButton;
+//     private boolean isInitailize = false;
        
        private LocationInjector injector = null;
        private Job injectJob = null;
@@ -109,60 +111,89 @@ public class MapImage extends AbstractInjectorPage {
 
        }
 
-       private void createGoogleMapScript() {
-               if(Map.host == null && Map.port == -1)
-               {
-                       try {                         
-                               //make a URL to a known source                         
-                               URL url = new URL("http://www.google.com");                          
-                               
-                               //open a connection to that source
-                               HttpURLConnection urlConnect = (HttpURLConnection)url.openConnection();
-                               //trying to retrieve data from the source. If there                         
-                               //is no connection, this line will fail
-                               urlConnect.connect();
-                               boolean isLoading = false;
-                               if (urlConnect.getResponseCode() != -1) {
-                                       // parsing title
-                                       BufferedReader in = new BufferedReader (new InputStreamReader(urlConnect.getInputStream()));
-                                       String line;
-                                       String pre = "<title>";
-                                       String tail = "</title>";
-
-                                       boolean isNextLine = false;
-                                       while((line = in.readLine()) != null) {
-                                               if (line.contains(pre) || isNextLine) {
-                                                       if (line.contains("google")) {
-                                                               isLoading = true;
-                                                       }
-                                                       if (!isLoading && !line.contains(tail)) {
-                                                               isNextLine = true;
-                                                               continue;
-                                                       }
-                                                       break;
-                                               }
-                                       }
-                                       in.close();
+       @Override
+       public void initializeContents() {
+               /*
+               if (!isInitailize) {
+                       createGoogleMapScript();
+                       createMapComposite();
+                       ((Map) getParent()).addViewer(viewer);
+                       isInitailize = true;
+               }
+               */
+       }
+
+       private String host = null;
+       private int port = -1;
+
+       private boolean checkProxy() {
+               System.setProperty("java.net.useSystemProxies","true");
+               try {
+                       List<Proxy> l = ProxySelector.getDefault().select(new URI("http://www.google.com/"));
+                       for (Proxy proxy : l ) {
+                               DebugLog.log("proxy hostname : " + proxy.type());
+                               InetSocketAddress addr = (InetSocketAddress)proxy.address();
+                               if(addr == null) {
+                                       DebugLog.log("no proxy");
+                                       return false;
+                               } else {
+                                       host = addr.getHostName();
+                                       port = addr.getPort();
+                                       DebugLog.log("proxy hostname : " + host);
+                                       DebugLog.log("proxy port : " + port);
+                                       return true;
                                }
+                       }
+               } catch (URISyntaxException e) {
+                       DebugLog.log("check the URI syntax.");
+               } catch (Exception e) {
+                       DebugLog.log("checkProxy() : " + e.getMessage());
+               }
+               return false;
+       }
+
+       private void createGoogleMapScript() {
+               CheckNetThread checkThread = new CheckNetThread();
 
-                               if (!isLoading) {
-                                       this.googleMapScript = "<html><head></head><body bgcolor=#dcdcdc oncontextmenu='return false'><br><br><br><br>" +
-                                                                               "<center>Failed to load the map.<br>Please check the network status!</center></body></html>";
-                                       return;
+               if (checkProxy()) {
+                       DebugLog.log("System proxy is used.");
+                       checkThread.start();
+                       synchronized(checkThread) {
+                               try {
+                                       checkThread.wait(5000);
+                               } catch (InterruptedException e) {
+                                       // TODO Auto-generated catch block
+                                       e.printStackTrace();
                                }
-                               urlConnect.disconnect();
-                       } catch (UnknownHostException e) {                         
-                               // TODO Auto-generated catch block                         
-                               //e.printStackTrace();
-                               this.googleMapScript = "<html><head></head><body bgcolor=#dcdcdc oncontextmenu='return false'><br><br><br><br><center>Can't connect to network.</center></body></html>";
+                       }
+                       if (!checkThread.isError()) {
+                               if (host != null) {
+                                       System.setProperty("network.proxy_host", host);
+                                       if (port != -1) {
+                                               System.setProperty("network.proxy_port", "" + port);
+                                       }
+                               }
+                       } else {
+                               DebugLog.log("Failure to access the site using system proxy.");
+                               this.googleMapScript = checkThread.getErrorMsg();
+                               //System.setProperty("java.net.useSystemProxies", "false");
                                return;
-                       }                 
-                       catch (IOException e) {                         
-                               // TODO Auto-generated catch block                         
-                               //e.printStackTrace();
-                               this.googleMapScript = "<html><head></head><body bgcolor=#dcdcdc oncontextmenu='return false'><br><br><br><br>" +
-                                               "<center>Failed to load the map.<br>" + e.getMessage() +
-                                               "</center></body></html>";
+                       }
+               } else {
+                       System.setProperty("java.net.useSystemProxies", "false");
+                       DebugLog.log("System proxy is not used.");
+                       checkThread.start();
+                       synchronized(checkThread) {
+                               try {
+                                       checkThread.wait(5000);
+                               } catch (InterruptedException e) {
+                                       // TODO Auto-generated catch block
+                                       e.printStackTrace();
+                               }
+                       }
+                       if (checkThread.isError()) {
+                               DebugLog.log("Failure to access the site.");
+                               this.googleMapScript = checkThread.getErrorMsg();
                                return;
                        }
                }
@@ -228,7 +259,7 @@ public class MapImage extends AbstractInjectorPage {
 
                        @Override
                        public void completed(ProgressEvent event) {
-//                             DebugLog.log("[Map] Map Loading: Compelete");
+                               DebugLog.log("[Map] Map Loading: Compelete");
                        }
 
                        @Override
@@ -388,15 +419,20 @@ public class MapImage extends AbstractInjectorPage {
                                if (browser != null) {
                                        try {
                                                // Reload Google Map
-                                               browser.refresh();
-                                               boolean bResult = browser.setText(googleMapScript);
+                                               boolean bResult = browser.execute("deleteMarkers()");
+                                               DebugLog.log("[Map] Browser execute deleteMakers() : "
+                                                               + (bResult ? "Success" : "Fail"));
+
+                                               if (!bResult) {
+                                                       bResult = browser.setText(googleMapScript);
+                                                       DebugLog.log("[Map] Browser reload : "
+                                                                       + (bResult ? "Success" : "Fail"));
+                                               }
 
                                                model.clear();
                                                ((Map) getParent()).refreshViewers();
                                                injectButton.setEnabled(validate());
                                                resetButton.setEnabled(validate());
-                                               DebugLog.log("[Map] Browser reload : "
-                                                               + (bResult ? "Success" : "Fail"));
                                        } catch (SWTException e) {
                                                e.printStackTrace();
                                        }
@@ -1,12 +1,12 @@
 /*
- * org.tizen.location.map
+ * org.tizen.injector.location.map
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.location.map.page;
+package org.tizen.injector.location.map.page;
 
 import org.eclipse.osgi.util.NLS;
 
 public class Messages extends NLS {
-       private static final String BUNDLE_NAME = "org.tizen.location.map.page.messages"; //$NON-NLS-1$
+       private static final String BUNDLE_NAME = "org.tizen.injector.location.map.page.messages"; //$NON-NLS-1$
        public static String MapImage_0;
        public static String MapImage_1;
        public static String MapImage_2;
similarity index 94%
rename from org.tizen.device/.project
rename to org.tizen.injector.nfc/.project
index d1e624e..7c4a8ca 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
-       <name>org.tizen.device</name>
+       <name>org.tizen.injector.nfc</name>
        <comment></comment>
        <projects>
        </projects>
similarity index 71%
rename from org.tizen.nfc/META-INF/MANIFEST.MF
rename to org.tizen.injector.nfc/META-INF/MANIFEST.MF
index 08695a4..fdba4e9 100644 (file)
@@ -1,9 +1,9 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Tizen Event Injector Nfc
-Bundle-SymbolicName: org.tizen.nfc;singleton:=true
+Bundle-SymbolicName: org.tizen.injector.nfc;singleton:=true
 Bundle-Version: 1.0.0.qualifier
-Bundle-Vendor: Samsung
+Bundle-Vendor: The Linux Foundation
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Require-Bundle: org.tizen.injector,
  org.eclipse.swt;bundle-version="3.6.2",
@@ -12,4 +12,7 @@ Require-Bundle: org.tizen.injector,
  org.eclipse.core.runtime;bundle-version="3.7.0",
  org.eclipse.core.commands;bundle-version="3.6.0"
 Import-Package: org.tizen.sdblib,
+ org.tizen.sdblib.exception,
+ org.tizen.sdblib.receiver,
+ org.tizen.sdblib.service,
  org.eclipse.ui.plugin
similarity index 74%
rename from org.tizen.nfc/plugin.xml
rename to org.tizen.injector.nfc/plugin.xml
index 2b0e9c3..bde865e 100644 (file)
@@ -5,8 +5,8 @@
          point="org.tizen.injector.injectorItemProvider">
       <itemType
             category="Nfc"
-            class="org.tizen.nfc.Nfc"
-            id="org.tizen.nfc"
+            class="org.tizen.injector.nfc.Nfc"
+            id="org.tizen.injector.nfc"
             name="Nfc">
       </itemType>
    </extension>
@@ -1,11 +1,13 @@
 /*
- * org.tizen.nfc.tag
+ * org.tizen.injector.nfc.tag
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact:
  * Jihye kim <jihye1128.kim@samsung.com>
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
  * Yeongkyoon Lee <yeongkyoon.lee@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * - S-Core Co., Ltd
  */
 
-package org.tizen.nfc;
+package org.tizen.injector.nfc;
 
+import org.tizen.injector.nfc.page.NfcPage;
 import org.tizen.injector.provider.AbstractInjectorItem;
-import org.tizen.nfc.page.NfcPage;
 
 public class Nfc extends AbstractInjectorItem
 {
@@ -1,11 +1,13 @@
 /*
- * org.tizen.nfc.tag.page
+ * org.tizen.injector.nfc.tag.page
  *
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact:
  * Jihye kim <jihye1128.kim@samsung.com>
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
  * Yeongkyoon Lee <yeongkyoon.lee@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,7 +26,7 @@
  * - S-Core Co., Ltd
  */
 
-package org.tizen.nfc.page;
+package org.tizen.injector.nfc.page;
 
 public class NDEFRecord
 {
diff --git a/org.tizen.injector.nfc/src/org/tizen/injector/nfc/page/NDEFRecordPage.java b/org.tizen.injector.nfc/src/org/tizen/injector/nfc/page/NDEFRecordPage.java
new file mode 100644 (file)
index 0000000..af9fa4e
--- /dev/null
@@ -0,0 +1,460 @@
+/*
+ * org.tizen.injector.nfc.tag.page
+ *
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jihye kim <jihye1128.kim@samsung.com>
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * Yeongkyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ */
+
+package org.tizen.injector.nfc.page;
+
+import java.util.ArrayList;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.tizen.injector.util.FormPageUtil;
+import org.tizen.sdblib.IDevice;
+
+public class NDEFRecordPage {
+       // add NDEFMessage
+       private String[] RecordFormatList       = RecordFormat.getInstance().getList();
+       private String[] TypeNameList           = TypeName.getInstance().getList();
+       private Combo cmbRecordFormat;
+       private Combo cmbRecordTypeName;
+       private Text txtRecordTypeName;
+       private Text txtRecordID;
+       private Text txtRecordPayload;
+       private Button butSelectMediaFile;
+
+       private Button butRecordAdd;
+       private Button butRecordEdit;
+       private Button butRecordRemove;
+
+       // message list length
+       private Label lblRecords;
+       private int nTotalLength = 0;
+       private final int nMaxNDFEMessageLength = 4096;
+       private Combo cmbRecordList;
+       private ArrayList<NDEFRecord> RecordList = new ArrayList<NDEFRecord>();
+
+       // check invalid characters
+       private NDEFRecord oldRecord = new NDEFRecord(0, "", "", "");
+       private boolean bCheckTypeNameText = true;
+       private boolean bCheckIDText = true;
+       private boolean bCheckPayloadText = true;
+
+       private NfcHelpProcess process = null;
+       private Shell shell;
+       private IDevice currentDevice = null;
+
+       public NDEFRecordPage(Shell shell) {
+               process = new NfcHelpProcess(shell);
+               this.shell = shell;
+       }
+
+       public void createNDEFMessageSection(FormPageUtil formUtil, Composite parent)
+       {
+               Composite client = formUtil.createSection(parent, "NDEF Message");
+               Composite messageComposite = formUtil.createComposite(client);
+
+               createRecordComposite(formUtil, messageComposite);
+
+               Composite buttonComposite = formUtil.createComposite(messageComposite, 3);
+               butRecordAdd    = formUtil.createButton(buttonComposite, "Add", SWT.PUSH);
+               butRecordEdit   = formUtil.createButton(buttonComposite, "Edit", SWT.PUSH);
+               butRecordRemove = formUtil.createButton(buttonComposite, "Remove",SWT.PUSH);
+
+               GridData gd1 = new GridData();
+               gd1.widthHint = 110;
+               butRecordAdd.setLayoutData(gd1);
+               butRecordEdit.setLayoutData(gd1);
+               butRecordRemove.setLayoutData(gd1);
+
+               butRecordAdd.addSelectionListener(new SelectionAdapter() {
+                       public void widgetSelected(SelectionEvent e) {
+                               addRecord();
+                       }
+               });
+               butRecordEdit.addSelectionListener(new SelectionAdapter() {
+                       public void widgetSelected(SelectionEvent e) {
+                               editRecord();
+                       }
+               });
+               butRecordRemove.addSelectionListener(new SelectionAdapter() {
+                       public void widgetSelected(SelectionEvent e) {
+                               removeRecord();
+                       }
+               });
+
+               Composite RecordComposite = formUtil.createComposite(messageComposite, 2);
+               GridData gd2 = new GridData();
+               gd2.widthHint = 160;
+               lblRecords = formUtil.createLabel(RecordComposite, String.format("Records [0/%d] ", nMaxNDFEMessageLength));
+               lblRecords.setLayoutData(gd2);
+
+               cmbRecordList = formUtil.createCombo(RecordComposite);
+               cmbRecordList.setLayoutData(gd2);
+               cmbRecordList.addSelectionListener(new SelectionAdapter() {
+                       public void widgetSelected(SelectionEvent e) {
+                               selectRecord();
+                       }
+               });
+       }
+
+       private void createRecordComposite(FormPageUtil formUtil, Composite parent)
+       {
+               GridData gd1 = new GridData();
+               gd1.widthHint = 200;
+
+               Composite messageComposite = formUtil.createComposite(parent, 2);
+
+               formUtil.createLabel(messageComposite, "Type Name Format ");
+               cmbRecordFormat = formUtil.createCombo(messageComposite);
+               cmbRecordFormat.setLayoutData(gd1);
+               formUtil.addComboItem(cmbRecordFormat, RecordFormatList);
+
+               formUtil.createLabel(messageComposite, "Type Name ");
+               txtRecordTypeName = formUtil.createText(messageComposite, "");
+               txtRecordTypeName.setLayoutData(gd1);
+               txtRecordTypeName.setTextLimit(250);
+
+               formUtil.createLabel(messageComposite, "");
+               cmbRecordTypeName = formUtil.createCombo(messageComposite);
+               formUtil.addComboItem(cmbRecordTypeName, TypeNameList);
+               cmbRecordTypeName.setLayoutData(gd1);
+
+               formUtil.createLabel(messageComposite, "ID ");
+               txtRecordID = formUtil.createText(messageComposite, "");
+               txtRecordID.setLayoutData(gd1);
+               txtRecordID.setTextLimit(250);
+
+               formUtil.createLabel(messageComposite, "Payload ");
+               txtRecordPayload = formUtil.createText(messageComposite, "");
+               txtRecordPayload.setLayoutData(gd1);
+               txtRecordPayload.setTextLimit(1024);
+
+               formUtil.createLabel(messageComposite, "");
+               butSelectMediaFile = formUtil.createButton(messageComposite,
+                                                        "Select Media File", SWT.PUSH);
+               butSelectMediaFile.setEnabled(false);
+               butSelectMediaFile.setLayoutData(new GridData(GridData.END,
+                                                                                GridData.END, false, false));
+
+               checkRecordFormat(0); //NDEF_TNF_EMPTY
+               addListener();
+       }
+       
+       private void addListener() {
+               cmbRecordFormat.addSelectionListener(new SelectionAdapter() {
+                       public void widgetSelected(SelectionEvent e) {
+                               Selected(e);
+                       }
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               Selected(e);
+                       }
+                       private void Selected(SelectionEvent e) {
+                               int i = cmbRecordFormat.getSelectionIndex();
+                               if (i != -1) {
+                                       checkRecordFormat(i);
+                                       txtRecordTypeName.setText("");
+                                       cmbRecordTypeName.select(0);
+                                       txtRecordID.setText("");
+                                       txtRecordPayload.setText("");
+                               }
+                       }
+               });
+
+               txtRecordTypeName.addModifyListener(new ModifyListener() {
+                       public void modifyText(ModifyEvent e) {
+                               if (bCheckTypeNameText == false) {
+                                       bCheckTypeNameText = true;
+                                       return;
+                               }
+                               if (process.checkInvalidCharaters(txtRecordTypeName.getText()) == false) {
+                                       txtRecordTypeName.setText(oldRecord.getTypeName());
+                                       return;
+                               }
+                               oldRecord.setTypeName(txtRecordTypeName.getText());
+                       }
+               });
+
+               txtRecordID.addModifyListener(new ModifyListener() {
+                       public void modifyText(ModifyEvent e) {
+                               if (bCheckIDText == false) {
+                                       bCheckIDText = true;
+                                       return;
+                               }
+                               if (process.checkInvalidCharaters(txtRecordID.getText()) == false) {
+                                       txtRecordID.setText(oldRecord.getId());
+                                       return;
+                               }
+                               oldRecord.setId(txtRecordID.getText());
+                       }
+               });
+
+               txtRecordPayload.addModifyListener(new ModifyListener() {
+                       public void modifyText(ModifyEvent e) {
+                               if (bCheckPayloadText == false) {
+                                       bCheckPayloadText = true;
+                                       return;
+                               }
+                               if (process.checkInvalidCharaters(txtRecordPayload.getText()) == false) {
+                                       txtRecordPayload.setText(oldRecord.getPayload());
+                                       return;
+                               }
+                               oldRecord.setPayload(txtRecordPayload.getText());
+                       }
+               });
+
+               butSelectMediaFile.addSelectionListener(new SelectionAdapter() {
+                       public void widgetSelected(SelectionEvent e) {
+                               String filePath = process.selectMediaFile(currentDevice);
+                               if (filePath != null) {
+                                       txtRecordTypeName.setEnabled(true);
+                       txtRecordTypeName.setEditable(false);
+                       txtRecordPayload.setEnabled(true);
+                       txtRecordPayload.setEditable(false);
+                       txtRecordTypeName.setText(process.checkFileType(filePath));
+                       txtRecordPayload.setText(filePath);
+                               }
+                       }
+               });
+       }
+       
+       private void selectRecord() {
+               int i = cmbRecordList.getSelectionIndex();
+               if (i != -1) {
+                       NDEFRecord record = RecordList.get(i);
+                       checkRecordFormat(record.getFormat());
+                       cmbRecordFormat.select(record.getFormat());
+
+                       if (record.getFormat() == 1) {
+                               if (record.getTypeName().compareTo("U") == 0)
+                                       cmbRecordTypeName.select(0);
+                               else
+                                       cmbRecordTypeName.select(1);
+                               txtRecordTypeName.setText("");
+                       } else {
+                               cmbRecordTypeName.select(0);
+                               txtRecordTypeName.setText(record.getTypeName());
+                       }
+
+                       txtRecordID.setText(record.getId());
+                       txtRecordPayload.setText(record.getPayload());
+               }
+       }
+
+       private void checkRecordFormat(int format)
+       {
+               switch (format) {
+               case 0: // NDEF_TNF_EMPTY
+                       cmbRecordTypeName.setEnabled(false);
+                       txtRecordTypeName.setEnabled(false);
+                       txtRecordID.setEnabled(false);
+                       txtRecordPayload.setEnabled(false);
+                       butSelectMediaFile.setEnabled(false);
+                       break;
+               case 1: // NDEF_TNF_WELL_KNOWN
+                       cmbRecordTypeName.setEnabled(true);
+                       cmbRecordTypeName.select(0);
+                       txtRecordTypeName.setEnabled(false);
+                       txtRecordID.setEnabled(true);
+                       txtRecordPayload.setEnabled(true);
+                       txtRecordPayload.setEditable(true);
+                       butSelectMediaFile.setEnabled(false);
+                       break;
+               case 2: // NDEF_TNF_MIME_MEDIA
+                       cmbRecordTypeName.setEnabled(false);
+                       txtRecordTypeName.setEnabled(false);
+                       txtRecordID.setEnabled(true);
+                       txtRecordPayload.setEnabled(false);
+                       butSelectMediaFile.setEnabled(true);
+                       break;
+               case 3: // NDEF_TNF_ABSOLUTE_URI
+                       cmbRecordTypeName.setEnabled(false);
+                       txtRecordTypeName.setEnabled(true);
+                       txtRecordTypeName.setEditable(true);
+                       txtRecordID.setEnabled(true);
+                       txtRecordPayload.setEnabled(false);
+                       butSelectMediaFile.setEnabled(false);
+                       break;
+               case 4: // NDEF_TNF_EXTERNAL
+                       cmbRecordTypeName.setEnabled(false);
+                       txtRecordTypeName.setEnabled(true);
+                       txtRecordTypeName.setEditable(true);
+                       txtRecordID.setEnabled(true);
+                       txtRecordPayload.setEnabled(true);
+                       txtRecordPayload.setEditable(true);
+                       butSelectMediaFile.setEnabled(false);
+                       break;
+               case 5: // NDEF_TNF_UNKNOWN
+                       cmbRecordTypeName.setEnabled(false);
+                       txtRecordTypeName.setEnabled(false);
+                       txtRecordID.setEnabled(true);
+                       txtRecordPayload.setEnabled(true);
+                       txtRecordPayload.setEditable(true);
+                       butSelectMediaFile.setEnabled(false);
+                       break;
+               default:
+                       break;
+               }
+               bCheckTypeNameText      = false;
+               bCheckIDText            = false;
+               bCheckPayloadText       = false;
+       }
+
+       private void addRecord()
+       {
+               if (RecordList.size() >= 5) {
+                       NfcDialog.openInfoDialog(shell, NfcErrorString.RecordCountIsMax);
+                       return;
+               }
+
+               NDEFRecord record = new NDEFRecord();
+
+               setRecordValue(record);
+               RecordList.add(record);
+               int temp = process.checkRecordlistMaxLength(RecordList, nMaxNDFEMessageLength);
+               if (temp == 0) {
+                       RecordList.remove(record);
+                       return;
+               } else {
+                       nTotalLength = temp;
+               }
+
+               lblRecords.setText(String.format("Records [%4d/%d] ", nTotalLength, nMaxNDFEMessageLength));
+               cmbRecordList.add("record item" + RecordList.indexOf(record));
+               cmbRecordList.clearSelection();
+       }
+
+       private void editRecord()
+       {
+               int i = cmbRecordList.getSelectionIndex();
+               if (i != -1) {
+                       NDEFRecord record = RecordList.get(i);
+                       NDEFRecord copyRecord = record;
+                       setRecordValue(record);
+
+                       int temp = process.checkRecordlistMaxLength(RecordList, nMaxNDFEMessageLength);
+                       if (temp == 0) {
+                               record = copyRecord;
+                               return;
+                       } else {
+                               nTotalLength = temp;
+                       }
+
+                       lblRecords.setText(String.format("Records [%4d/%d] ",   nTotalLength, nMaxNDFEMessageLength));
+               }
+       }
+
+       private void removeRecord()
+       {
+               int index = cmbRecordList.getSelectionIndex();
+               if (index != -1) {
+                       RecordList.remove(index);
+                       cmbRecordList.removeAll();
+                       for (int i = 0; i < RecordList.size(); i++) {
+                               cmbRecordList.add("record item" + i);
+                       }
+                       cmbRecordList.clearSelection();
+               }
+
+               nTotalLength = process.checkRecordlistMaxLength(RecordList, nMaxNDFEMessageLength);
+               lblRecords.setText(String.format("Records [%4d/%d] ", nTotalLength, nMaxNDFEMessageLength));
+               txtRecordTypeName.setText("");
+               cmbRecordTypeName.select(0);
+               txtRecordID.setText("");
+               txtRecordPayload.setText("");
+       }
+
+       private void setRecordValue(NDEFRecord record)
+       {
+               record.setFormat(cmbRecordFormat.getSelectionIndex());
+
+               if ((cmbRecordFormat.getSelectionIndex()) == 1) {
+                       record.setTypeName(TypeNameList[cmbRecordTypeName.getSelectionIndex()]);
+               } else {
+                       if (txtRecordTypeName.getText().isEmpty() == true)
+                               record.setTypeName("Null");
+                       else
+                               record.setTypeName(txtRecordTypeName.getText());
+               }
+
+               if (txtRecordID.getText().isEmpty() == true)
+                       record.setId("Null");
+               else
+                       record.setId(txtRecordID.getText());
+
+               if (txtRecordPayload.getText().isEmpty() == true)
+                       record.setPayload("Null");
+               else
+                       record.setPayload(txtRecordPayload.getText());
+       }
+
+       public IDevice getCurrentDevice() {
+               return currentDevice;
+       }
+
+       public void setCurrentDevice(IDevice currentDevice) {
+               this.currentDevice = currentDevice;
+       }
+
+       public  ArrayList<NDEFRecord> getRecordList() {
+               return RecordList;
+       }
+       
+       public void setDisableState() {
+               cmbRecordFormat.setEnabled(false);
+               checkRecordFormat(0);
+
+               cmbRecordList.setEnabled(false);
+               butRecordAdd.setEnabled(false);
+               butRecordEdit.setEnabled(false);
+               butRecordRemove.setEnabled(false);
+       }
+       
+       public void setEnableState() {
+               cmbRecordFormat.setEnabled(true);
+
+               checkRecordFormat(cmbRecordFormat.getSelectionIndex());
+               txtRecordTypeName.setText("");
+               cmbRecordTypeName.select(0);
+               txtRecordID.setText("");
+               txtRecordPayload.setText("");
+
+               cmbRecordList.setEnabled(true);
+               butRecordAdd.setEnabled(true);
+               butRecordEdit.setEnabled(true);
+               butRecordRemove.setEnabled(true);
+       }
+}
@@ -1,11 +1,13 @@
 /*
- * org.tizen.nfc.tag.page
+ * org.tizen.injector.nfc.tag.page
  *
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact:
  * Jihye kim <jihye1128.kim@samsung.com>
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
  * Yeongkyoon Lee <yeongkyoon.lee@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,7 +26,7 @@
  * - S-Core Co., Ltd
  */
 
-package org.tizen.nfc.page;
+package org.tizen.injector.nfc.page;
 
 public class NfcCommand
 {
@@ -1,11 +1,13 @@
 /*
- * org.tizen.nfc.tag.page
+ * org.tizen.injector.nfc.tag.page
  *
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact:
  * Jihye kim <jihye1128.kim@samsung.com>
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
  * Yeongkyoon Lee <yeongkyoon.lee@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,7 +26,7 @@
  * - S-Core Co., Ltd
  */
 
-package org.tizen.nfc.page;
+package org.tizen.injector.nfc.page;
 
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Display;
diff --git a/org.tizen.injector.nfc/src/org/tizen/injector/nfc/page/NfcHelpProcess.java b/org.tizen.injector.nfc/src/org/tizen/injector/nfc/page/NfcHelpProcess.java
new file mode 100644 (file)
index 0000000..8a9cbe6
--- /dev/null
@@ -0,0 +1,315 @@
+/*
+ * org.tizen.injector.nfc.tag.page
+ *
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jihye kim <jihye1128.kim@samsung.com>
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * Yeongkyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ */
+
+package org.tizen.injector.nfc.page;
+
+import java.io.IOException;
+import java.util.ArrayList;
+
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.common.connection.ConnectionPlugin;
+import org.tizen.common.connection.ui.TizenRemoteFileDialog;
+import org.tizen.common.connection.ui.TizenRemoteFileDialog.TizenRemoteFileDialogResult;
+import org.tizen.injector.socket.TelephonySocket;
+import org.tizen.sdblib.IDevice;
+import org.tizen.sdblib.exception.SdbCommandRejectedException;
+import org.tizen.sdblib.exception.ShellCommandUnresponsiveException;
+import org.tizen.sdblib.exception.TimeoutException;
+import org.tizen.sdblib.receiver.MultiLineReceiver;
+import org.tizen.sdblib.service.FileEntry;
+
+public class NfcHelpProcess {
+       private Shell shell = null;
+
+       public NfcHelpProcess(Shell shell) {
+               this.shell = shell;
+       }
+
+       public boolean checkInvalidCharaters(String text)
+       {
+               char[] textArray = new char[1000];
+               text.getChars(0, text.length(), textArray, 0);
+
+               for (int i = 0; i < text.length(); i++) {
+                       char c = textArray[i];
+                       if (c == '\n') {
+                               NfcDialog.openInfoDialog(shell, NfcErrorString.InvalidCharNewLine);
+                               return false;
+                       }
+                       
+                       if (c == ',') {
+                               NfcDialog.openInfoDialog(shell, NfcErrorString.InvalidChar);
+                               return false;
+                       }
+
+                       if (c >= 0x80) {
+                               NfcDialog.openInfoDialog(shell, NfcErrorString.InvalidCharAscii);
+                               return false;
+                       }
+               }
+               return true;
+       }
+
+       public int checkRecordlistMaxLength(ArrayList<NDEFRecord> RecordList, int maxLen)
+       {
+               int lenList = 0;
+
+               for (NDEFRecord record : RecordList) {
+                       lenList += 1 + record.getTypeName().length()
+                                   + record.getId().length() + record.getPayload().length() + 4;
+               }
+
+               if (lenList > maxLen) {
+                       NfcDialog.openInfoDialog(shell, "The length of the NDEF message has reached the maxium limit of "
+                                                                                       + maxLen + " bytes\n");
+                       return 0;
+               }
+
+               return lenList;
+       }
+
+       private static String MediaFilePath = null;
+       private String shellCmd    = null;
+       private String shellResult = null;
+
+       public String selectMediaFile(final IDevice currentDevice)
+       {
+               MediaFilePath = null;
+               if (shell != null) {
+                       shell.getDisplay().syncExec(new Runnable() {
+                               public void run() {
+                                       TizenRemoteFileDialog dlg = new TizenRemoteFileDialog(
+                                                       shell, "Select a media file", currentDevice, false,
+                                                       "/opt/nfc");
+                                       if (dlg.open() == TizenRemoteFileDialogResult.OK) {
+                                               FileEntry fileEntry = dlg.getSelectedFileEntry();
+                                               MediaFilePath = fileEntry.getFullPath();
+                                       }
+                               }
+                       });
+               } else {
+                       NfcDialog.openErrorDialog(NfcErrorString.FailOpenDialog);
+               }
+
+               if (MediaFilePath == null) {
+                       NfcDialog.openErrorDialog(shell, NfcErrorString.EmptyFilePath);
+               } else {
+                       String type = null;
+                       type = checkFileType(MediaFilePath);
+                       if (type == null) {
+                               NfcDialog.openErrorDialog(shell, NfcErrorString.NotMimeType);
+                               return null;
+                       }
+                       if (checkFileSize(currentDevice, MediaFilePath) == false) {
+                               NfcDialog.openErrorDialog(shell, NfcErrorString.BigSizeFile);
+                               return null;
+                       }
+               }
+               return MediaFilePath;
+       }
+
+       public String checkFileType(String filePath) {
+               int index   = filePath.lastIndexOf('.');
+               String type = null;
+               if (index != -1) {
+                       String ex = filePath.substring(index + 1);
+                       MimeTypeList typelist = MimeTypeList.getInstance();
+
+                       type = typelist.findMimeType(ex);
+               }
+               return type;
+       }
+
+       private boolean checkFileSize(final IDevice currentDevice, String filePath) {
+               boolean result = false;
+               shellCmd    = "du " + filePath;
+               try {
+                       currentDevice.executeShellCommand(shellCmd, new MultiLineReceiver() {
+                               @Override
+                               public void processNewLines(String[] lines) {
+                                       shellResult = lines[0];
+                               }
+                               
+                       });
+               } catch (TimeoutException e) {
+                       errorSelectMediaFile(e);
+                       return result;
+               } catch (SdbCommandRejectedException e) {
+                       errorSelectMediaFile(e);
+                       return result;
+               } catch (ShellCommandUnresponsiveException e) {
+                       errorSelectMediaFile(e);
+                       return result;
+               } catch (IOException e) {
+                       errorSelectMediaFile(e);
+                       return result;
+               }
+               if (shellResult != null) {
+                       int index = shellResult.indexOf('\t');
+                       if (index != -1) {
+                               shellResult = shellResult.substring(0, index);
+                               
+                               if (Integer.valueOf(shellResult) <= 10) {
+                                       result = true;
+                               }
+                       }
+               }
+               return result;
+       }
+
+       private void errorSelectMediaFile(Exception e) {
+               NfcDialog.openErrorDialog(shell, NfcErrorString.MediaFileException + e.getMessage());
+       }
+       
+       private void errorCheckVconf(Exception e) {
+               NfcDialog.openErrorDialog(shell, NfcErrorString.CheckVconfException + e.getMessage());
+       }
+
+       private boolean checkVconfValue() {
+               boolean result = false;
+               IDevice currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
+               shellCmd = "vconftool get db/nfc/enable";
+               try {
+                       currentDevice.executeShellCommand(shellCmd, new MultiLineReceiver() {
+                               @Override
+                               public void processNewLines(String[] lines) {
+                                       shellResult = lines[0];
+                               }
+                       });
+               } catch (TimeoutException e) {
+                       errorCheckVconf(e);
+                       return result;
+               } catch (SdbCommandRejectedException e) {
+                       errorCheckVconf(e);
+                       return result;
+               } catch (ShellCommandUnresponsiveException e) {
+                       errorCheckVconf(e);
+                       return result;
+               } catch (IOException e) {
+                       errorCheckVconf(e);
+                       return result;
+               }
+               if (shellResult != null) {
+                       if (shellResult.indexOf('1') != -1) {
+                               result = true;
+                       } else {
+                               NfcDialog.openInfoDialog(shell, NfcErrorString.NFCIsDisable);
+                       }
+               }
+
+               return result;
+       }
+
+       public boolean sendMessage(Integer type, int tagType, ArrayList<NDEFRecord> RecordList)
+       {
+               if (!checkVconfValue()) {
+                       if (type == NfcCommand.NFC_TAG_DISCOVERED
+                               || type == NfcCommand.NFC_P2P_DISCOVERED
+                || type == NfcCommand.NFC_P2P_SEND) {
+                               return false;
+                       } else {
+                               // for initializing the state
+                               return true;
+                       }
+               }
+
+               String msg = null;
+               switch (type) {
+               case 100: // NFC_TAG_DISCOVERED
+               {
+                       if (tagType != -1 && tagType != 0) {
+                               String records = new String();
+                               records += "," + RecordList.size();
+                               for (NDEFRecord record : RecordList) {
+                                       records += "," + record.getFormat() + ","
+                                                       + record.getTypeName() + "," + record.getId() + ","
+                                                       + record.getPayload();
+                               }
+
+                               msg = NfcCommand.NFC_TAG_DISCOVERED.toString() + ":"
+                                               + String.valueOf(tagType) + records + "\n";
+
+                       } else {
+                               NfcDialog.openErrorDialog(shell, NfcErrorString.SelecTagType);
+                               return false;
+                       }
+               }
+                       break;
+               case 101: // NFC_TAG_DETACHED
+                       msg = NfcCommand.NFC_TAG_DETACHED.toString() + ":" + "\n";
+                       break;
+               case 102: // NFC_P2P_DISCOVERED
+                       msg = NfcCommand.NFC_P2P_DISCOVERED.toString() + ":\n";
+                       break;
+               case 103: // NFC_P2P_DETACHED
+                       msg = NfcCommand.NFC_P2P_DETACHED.toString() + ":\n";
+                       break;
+               case 104: // NFC_P2P_SEND
+               {
+                       int tagtype = 5;        // for peer to peer
+                       String records = new String();
+                       records += "," + RecordList.size();
+                       for (NDEFRecord record : RecordList) {
+                               records += "," + record.getFormat() + ","
+                                               + record.getTypeName() + "," + record.getId() + ","
+                                               + record.getPayload();
+                       }
+
+                       msg = NfcCommand.NFC_P2P_SEND.toString() + ":"
+                               + String.valueOf(tagtype) + records + "\n";
+               }
+                       break;
+               default:
+                       break;
+               }
+
+               if (msg != null) {
+                       return send(msg);
+               } else {
+                       return false;
+               }
+       }
+
+       private TelephonySocket injectorSocket = TelephonySocket.getInstance();
+       private boolean send(String msg)
+       {
+               boolean result = false;
+               try {
+                       result = injectorSocket.sendNfc(msg);
+               } catch (IOException e1) {
+                       e1.printStackTrace();
+               } catch (Exception e1) {
+                       e1.printStackTrace();
+               }
+
+               return result;
+       }
+
+}
@@ -1,11 +1,13 @@
 /*
- * org.tizen.nfc.tag.page
+ * org.tizen.injector.nfc.tag.page
  *
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact:
  * Jihye kim <jihye1128.kim@samsung.com>
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
  * Yeongkyoon Lee <yeongkyoon.lee@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,7 +26,7 @@
  * - S-Core Co., Ltd
  */
 
-package org.tizen.nfc.page;
+package org.tizen.injector.nfc.page;
 
 import java.util.ArrayList;
 
diff --git a/org.tizen.injector.nfc/src/org/tizen/injector/nfc/page/NfcPage.java b/org.tizen.injector.nfc/src/org/tizen/injector/nfc/page/NfcPage.java
new file mode 100644 (file)
index 0000000..b84e408
--- /dev/null
@@ -0,0 +1,326 @@
+/*
+ * org.tizen.injector.nfc.tag.page
+ *
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jihye kim <jihye1128.kim@samsung.com>
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * Yeongkyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ */
+
+package org.tizen.injector.nfc.page;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+import org.tizen.common.connection.ConnectionPlugin;
+import org.tizen.common.connection.ConnectionPlugin.ISelectionListener;
+import org.tizen.injector.provider.AbstractInjectorItem;
+import org.tizen.injector.provider.AbstractInjectorPage;
+import org.tizen.injector.view.InjectorView;
+import org.tizen.sdblib.IDevice;
+import org.tizen.sdblib.service.FileEntry;
+
+public class NfcPage extends AbstractInjectorPage implements ISelectionListener
+{
+       // NDEF record
+       private NDEFRecordPage recordPage = null;
+
+       // add Tag
+       private String[] TagTypeList = TagType.getInstance().getList();
+       private Combo cmbTagTypeList;
+       private Button butTagAttach;
+       private Button butTagDetach;
+
+       // add P2P
+       private Button butP2PDiscover;
+       private Button butP2PSend;
+       private Button butP2PDetach;
+
+       private IDevice currentDevice;
+       private Shell shell = null;
+
+       private NfcHelpProcess process = null;
+
+       public NfcPage(AbstractInjectorItem item, String name)
+       {
+               super(item, name);
+       }
+
+       @Override
+       protected void createContents()
+       {
+               InjectorView.getDefault().addSelectionListener(this);
+               currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
+
+               shell = parent.getShell();
+               process         = new NfcHelpProcess(shell);
+               recordPage      = new NDEFRecordPage(shell);
+               recordPage.setCurrentDevice(currentDevice);
+
+               recordPage.createNDEFMessageSection(formUtil, parent);
+               createTagSection();
+               createP2PSection();
+
+               boolean connected = checkDeviceConnectedAlready();
+               if (connected == true) {
+                       connect();
+               }
+       }
+
+       private void createTagSection()
+       {
+               Composite client                = formUtil.createSection(parent, "NFC Tag");
+               Composite mainComposite = formUtil.createComposite(client, 3);
+
+               formUtil.createLabel(mainComposite, "Tag Type ");
+               cmbTagTypeList = formUtil.createCombo(mainComposite);
+               GridData gd1 = new GridData();
+               gd1.widthHint = 180;
+               cmbTagTypeList.setLayoutData(gd1);
+               formUtil.addComboItem(cmbTagTypeList, TagTypeList, TagTypeList[0]);
+
+               GridData gd2 = new GridData();
+               gd2.widthHint = 100;
+
+               butTagAttach = formUtil.createButton(mainComposite, "Tag Attach", SWT.PUSH);
+               butTagAttach.setLayoutData(gd2);
+
+               formUtil.createLabel(mainComposite, "");
+               formUtil.createLabel(mainComposite, "");
+               butTagDetach = formUtil.createButton(mainComposite, "Tag Detach", SWT.PUSH);
+               butTagDetach.setLayoutData(gd2);
+               butTagDetach.setEnabled(false);
+
+               butTagAttach.addSelectionListener(new SelectionAdapter() {
+                       public void widgetSelected(SelectionEvent e) {
+                               clickTagDiscovered();
+                       }
+               });
+
+               butTagDetach.addSelectionListener(new SelectionAdapter() {
+                       public void widgetSelected(SelectionEvent e) {
+                               clickTagDetached();
+                       }
+               });
+       }
+
+       private void createP2PSection()
+       {
+               Composite client                = formUtil.createSection(parent, "Peer to Peer");
+               Composite mainComposite = formUtil.createComposite(client, 2);
+
+               butP2PDiscover  = formUtil.createButton(mainComposite, "P2P Discovered", SWT.PUSH);
+               butP2PDetach    = formUtil.createButton(mainComposite, "P2P Detached", SWT.PUSH);
+               butP2PSend              = formUtil.createButton(mainComposite, "P2PSend", SWT.PUSH);
+               
+               // TODO
+               butP2PDiscover.setEnabled(true);
+               butP2PDetach.setEnabled(false);
+               butP2PSend.setEnabled(false);
+               //
+
+               GridData gd = new GridData();
+               gd.widthHint = 170;
+               butP2PDiscover.setLayoutData(gd);
+               butP2PDetach.setLayoutData(gd);
+               butP2PSend.setLayoutData(gd);
+
+               butP2PDiscover.addSelectionListener(new SelectionAdapter() {
+                       public void widgetSelected(SelectionEvent e)
+                       {
+                               clickP2PDiscovered();
+                       }
+               });
+
+               butP2PDetach.addSelectionListener(new SelectionAdapter() {
+                       public void widgetSelected(SelectionEvent e)
+                       {
+                               clickP2PDetached();
+                       }
+               });
+
+               butP2PSend.addSelectionListener(new SelectionAdapter() {
+                       public void widgetSelected(SelectionEvent e)
+                       {
+                               clickP2PSend();
+                       }
+               });
+       }
+
+       private void clickTagDiscovered() {
+               // check count of record list;
+               if (recordPage.getRecordList().size() == 0) {
+                       NfcDialog.openInfoDialog(shell, NfcErrorString.RecordCountIsZero);
+                       return;
+               }
+
+               boolean result = process.sendMessage(NfcCommand.NFC_TAG_DISCOVERED,
+                                        cmbTagTypeList.getSelectionIndex(), recordPage.getRecordList());
+               if (result) {
+                       recordPage.setDisableState();
+
+                       cmbTagTypeList.setEnabled(false);
+                       butTagAttach.setEnabled(false);
+                       butTagDetach.setEnabled(true);
+                       
+                       butP2PDiscover.setEnabled(false);
+                       butP2PDetach.setEnabled(false);
+                       butP2PSend.setEnabled(false);
+               }
+       }
+
+       private void clickTagDetached() {
+               boolean result = process.sendMessage(NfcCommand.NFC_TAG_DETACHED,
+                                        cmbTagTypeList.getSelectionIndex(), recordPage.getRecordList());
+               if (result) {
+                       recordPage.setEnableState();
+
+                       cmbTagTypeList.setEnabled(true);
+                       butTagAttach.setEnabled(true);
+                       butTagDetach.setEnabled(false);
+                       
+                       butP2PDiscover.setEnabled(true);
+                       butP2PDetach.setEnabled(false);
+                       butP2PSend.setEnabled(false);
+               }
+       }
+
+       private void clickP2PDiscovered() {
+               boolean result = process.sendMessage(NfcCommand.NFC_P2P_DISCOVERED,
+                                        cmbTagTypeList.getSelectionIndex(), recordPage.getRecordList());
+               if (result) {
+                       cmbTagTypeList.setEnabled(false);
+                       butTagAttach.setEnabled(false);
+                       butTagDetach.setEnabled(false);
+                       
+                       butP2PDiscover.setEnabled(false);
+                       butP2PDetach.setEnabled(true);
+                       butP2PSend.setEnabled(true);    
+               }
+               
+       }
+       
+       private void clickP2PDetached() {
+               boolean result = process.sendMessage(NfcCommand.NFC_P2P_DETACHED,
+                                       cmbTagTypeList.getSelectionIndex(), recordPage.getRecordList());
+               if (result) {
+                       recordPage.setEnableState();
+
+                       cmbTagTypeList.setEnabled(true);
+                       butTagAttach.setEnabled(true);
+                       butTagDetach.setEnabled(false);
+                       
+                       butP2PDiscover.setEnabled(true);
+                       butP2PDetach.setEnabled(false);
+                       butP2PSend.setEnabled(false);
+               }
+       }
+
+       private void clickP2PSend() {
+               // check count of record list;
+               if (recordPage.getRecordList().size() == 0) {
+                       NfcDialog.openInfoDialog(shell, NfcErrorString.RecordCountIsZero);
+                       return;
+               }
+
+               boolean result = process.sendMessage(NfcCommand.NFC_P2P_SEND,
+                                       cmbTagTypeList.getSelectionIndex(), recordPage.getRecordList());
+               if (result) {
+                       recordPage.setDisableState();
+
+                       cmbTagTypeList.setEnabled(false);
+                       butTagAttach.setEnabled(false);
+                       butTagDetach.setEnabled(false);
+
+                       butP2PDiscover.setEnabled(false);
+                       butP2PDetach.setEnabled(true);
+                       butP2PSend.setEnabled(false);
+               } else {
+                       recordPage.setEnableState();
+
+                       cmbTagTypeList.setEnabled(true);
+                       butTagAttach.setEnabled(true);
+                       butTagDetach.setEnabled(false);
+
+                       butP2PDiscover.setEnabled(true);
+                       butP2PDetach.setEnabled(false);
+                       butP2PSend.setEnabled(false);
+        }
+       }
+
+       private boolean checkDeviceConnectedAlready()
+       {
+               if (currentDevice == null)
+                       return false;
+               else
+                       return true;
+       }
+
+       @Override
+       protected void registerReceivers()
+       {
+       }
+
+       // @Override
+       public void connect()
+       {
+               currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
+               recordPage.setCurrentDevice(currentDevice);
+       }
+
+       // @Override
+       public void disconnect()
+       {
+       }
+
+       @Override
+       protected void finalize() throws Throwable
+       {
+               InjectorView.getDefault().removeSelectionListener(this);
+               super.finalize();
+       }
+
+       @Override
+       public void selectionChanged(FileEntry selectedEntry)
+       {
+               if (selectedEntry == null) {
+                       disconnect();
+               } else {
+                       String selectedName = selectedEntry.getDevice().getSerialNumber();
+                       if (currentDevice == null) {
+                               if (selectedName != null) {
+                                       connect();
+                               }
+                       } else {
+                               if (currentDevice.getSerialNumber() != selectedName) {
+                                       disconnect();
+                                       connect();
+                               }
+                       }
+               }
+       }
+}
diff --git a/org.tizen.injector.nfc/src/org/tizen/injector/nfc/page/NfcStringResource.java b/org.tizen.injector.nfc/src/org/tizen/injector/nfc/page/NfcStringResource.java
new file mode 100644 (file)
index 0000000..81fdac0
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * org.tizen.injector.nfc.tag.page
+ *
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jihye kim <jihye1128.kim@samsung.com>
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * Yeongkyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ */
+
+package org.tizen.injector.nfc.page;
+
+import java.util.ArrayList;
+
+class NfcErrorString {
+       public static String RecordCountIsZero = "NDEF record list is empty\nAt least one or more records are required.";
+       public static String RecordCountIsMax = "The number of NDEF records has reached the maximum limit of 5.\n";
+       public static String MessageLenIsMax  = "The length of the NDEF messag has reached the maximun limit of 4096 bytes.\n";
+       public static String MediaFileException = "Throw exception while select media file.\n";
+       public static String CheckVconfException = "Throw exception while check NFC state of emulator.\n";
+
+       public static String SelecTagType = "Select Tag Type !!\n";
+
+       // check char of NFDE record
+       public static String InvalidCharNewLine = "Can not enter a newline character.\n";
+       public static String InvalidChar = "Can not enter ',' character.\nThis character is used separater character.\n";
+       public static String InvalidCharAscii = "Invalid characters are entered.\nOnly ASCII characters can be entered.\n";
+
+       // select media file
+       public static String FailOpenDialog = "Can not open emulator's file dialog.\n";
+       public static String EmptyFilePath = "Please choose media file.\n";
+       public static String NotMimeType = "Type of selected file is not mime media type.\n";
+       public static String BigSizeFile = "Size of selected file is too big.\nAvailable file size is under of 10KB.\n";
+
+       // check vconf
+       public static String NFCIsDisable = "NFC state is 'Off' in the emulator.\nPlease change NFC state is 'On' on the setting menu.";
+}
+
+class NfcStringArray
+{
+       private ArrayList<String> list;
+       
+       public NfcStringArray()
+       {
+               list = new ArrayList<String>();
+       }
+
+       public void add(int index, String element)
+       {
+               list.add(index, element);
+       }
+
+       public String[] getList()
+       {
+               return list.toArray(new String[size()]);
+       }
+       
+       public int size()
+       {
+               return list.size();
+       }
+}
+
+class TagType extends NfcStringArray
+{
+       private static TagType tagtype = new TagType();
+       public static TagType getInstance()
+       {
+               return tagtype;
+       }
+
+       private TagType()
+       {
+               add(0, "");
+               add(1, "Topaz Jewel (Type1)");
+               add(2, "Mifare UL (Type2)");
+               add(3, "Felica (Type3)");
+               add(4, "Mifare Desfire (Type4)");
+       }
+
+}
+
+class RecordFormat extends NfcStringArray
+{
+       private static RecordFormat format = new RecordFormat();
+       public static RecordFormat getInstance()
+       {
+               return format;
+       }
+
+       private RecordFormat()
+       {
+               add(0, "NDEF_TNF_EMPTY");
+               add(1, "NDEF_TNF_WELL_KNOWN");
+               add(2, "NDEF_TNF_MIME_MEDIA");
+               add(3, "NDEF_TNF_ABSOLUTE_URI");
+               add(4, "NDEF_TNF_EXTERNAL");
+               add(5, "NDEF_TNF_UNKNOWN");
+       }
+}
+
+class TypeName extends NfcStringArray
+{
+       private static TypeName typename = new TypeName();
+       public static TypeName getInstance()
+       {
+               return typename;
+       }
+
+       private TypeName()
+       {
+               add(0, "U");
+               add(1, "T");
+       }
+}
\ No newline at end of file
diff --git a/org.tizen.injector.sensor.accelerometer/.project b/org.tizen.injector.sensor.accelerometer/.project
new file mode 100644 (file)
index 0000000..736c771
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.tizen.injector.sensor.accelerometer</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+       </natures>
+</projectDescription>
@@ -1,12 +1,14 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Tizen Event Injector Sensor Accelerometer
-Bundle-SymbolicName: org.tizen.sensor.accelerometer;singleton:=true
+Bundle-SymbolicName: org.tizen.injector.sensor.accelerometer;singleton:=true
 Bundle-Version: 1.0.0.qualifier
-Bundle-Vendor: Samsung
+Bundle-Vendor: The Linux Foundation
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Require-Bundle: org.eclipse.ui;bundle-version="3.5.2",
  org.tizen.injector,
  org.tizen.common,
  org.tizen.common.connection,
   org.eclipse.core.runtime;bundle-version="3.7.0"
+Import-Package: org.tizen.sdblib,
+ org.tizen.sdblib.service
@@ -5,8 +5,8 @@
          point="org.tizen.injector.injectorItemProvider">
       <itemType
             category="Sensor"
-            class="org.tizen.sensor.accelerometer.Sensor"
-            id="org.tizen.sensor.accelerometer"
+            class="org.tizen.injector.sensor.accelerometer.Sensor"
+            id="org.tizen.injector.sensor.accelerometer"
             name="3-Axis Sensors">
       </itemType>
    </extension>
diff --git a/org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/accelerometer/FileListVO.java b/org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/accelerometer/FileListVO.java
new file mode 100644 (file)
index 0000000..28e071e
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * org.tizen.injector.telephony.call
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.sensor.accelerometer;
+
+import org.tizen.injector.model.AbstractTableVO;
+
+public class FileListVO extends AbstractTableVO {
+       private int num;
+       private String filePath;
+       
+       public String getFilePath() {
+               return filePath;
+       }
+
+       public void setFilePath(String filePath) {
+               this.filePath = filePath;
+       }
+
+       public int getNum() {
+               return this.num;
+       }
+       
+       public void setNum(int number) {
+               this.num = number;
+       }
+       
+       @Override
+       public String[] getColumnNames() {
+               return null;
+       }
+
+       @Override
+       public Object getColumnValue(int index) {
+               Object obj = null;
+               switch (index) {
+                       case 0:
+                               obj = getNum();
+                               break;
+                       case 1:
+                               obj = getFilePath();
+                               break;
+                       default:
+                               break;
+               }
+               return obj;
+       }
+
+       @Override
+       public void setColumnValue(int index, Object value) {
+
+       }
+}
diff --git a/org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/accelerometer/Sensor.java b/org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/accelerometer/Sensor.java
new file mode 100644 (file)
index 0000000..d279582
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * org.tizen.injector.sensor.accelerometer
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.sensor.accelerometer;
+
+import org.tizen.injector.provider.AbstractInjectorItem;
+import org.tizen.injector.sensor.accelerometer.page.Accelerometer;
+import org.tizen.injector.sensor.accelerometer.page.ManualInputAccel;
+import org.tizen.injector.sensor.accelerometer.page.ManualInputGyro;
+import org.tizen.injector.sensor.accelerometer.page.ManualInputMagnetic;
+
+public class Sensor extends AbstractInjectorItem {
+
+       @Override
+       protected void addPages() {
+               addPage(new Accelerometer(this, String.format("%-16s", "GUI")));
+               addPage(new ManualInputAccel(this, String.format("%-13s", "Acceleration")));
+               addPage(new ManualInputMagnetic(this, String.format("%-13s", "Magnetic")));
+//             addPage(new ManualInputTilt(this, String.format("%-16s", "Tilt")));
+               addPage(new ManualInputGyro(this, String.format("%-13s", "Gyro")));
+       }
+}
diff --git a/org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/accelerometer/SensorConstants.java b/org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/accelerometer/SensorConstants.java
new file mode 100644 (file)
index 0000000..740f5e3
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * org.tizen.injector.device.battery
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.sensor.accelerometer;
+
+public class SensorConstants {
+       public static final String ACCEL_ID = "1\n";
+       public static final String GYRO_ID = "4\n";
+       public static final String GEO_ID = "5\n";
+       public static final String TILT_ID = "12\n";
+       public static final String MAGNETIC_ID = "13\n";
+       
+       public static final String FILE_ACCEL_ID = "14\n";
+       public static final String FILE_MAGNETIC_ID = "15\n";
+       public static final String FILE_GYRO_ID = "16\n";
+}
@@ -1,12 +1,12 @@
 /*
- * org.tizen.sensor.accelerometer
+ * org.tizen.injector.sensor.accelerometer
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.sensor.accelerometer.page;
+package org.tizen.injector.sensor.accelerometer.page;
 
 import java.awt.Frame;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
+import java.io.IOException;
 import java.text.DecimalFormat;
 
 import javax.swing.Timer;
@@ -56,8 +57,8 @@ import org.eclipse.ui.PlatformUI;
 import org.tizen.injector.protocol.sensor.TestSensorMessage;
 import org.tizen.injector.provider.AbstractInjectorItem;
 import org.tizen.injector.provider.AbstractInjectorPage;
-import org.tizen.sensor.magnetic.Magnetic;
-//import org.tizen.sensor.accelerometer.DebugLog;
+import org.tizen.injector.sensor.accelerometer.SensorConstants;
+import org.tizen.injector.sensor.magnetic.Magnetic;
 
 public class Accelerometer extends AbstractInjectorPage {
        Slider yawSlider, pitchSlider, rollSlider;
@@ -65,11 +66,12 @@ public class Accelerometer extends AbstractInjectorPage {
        double xValue, yValue, zValue;
        Mode mode;
        MobilePanel panel;
-       Button checkboxAccelerometer;
+       Button checkboxAcceleration;
        Button checkboxGyro;
-    Button checkboxGeoMagnetic;
-    Button checkboxOrientation;
+    Button checkboxMagnetic;
+    Button checkboxTilt;
     Button button01, button02, button03;
+    Button withAxisCheck;
     private Text dataText;
     Timer dataOutputTimer;
     
@@ -86,12 +88,12 @@ public class Accelerometer extends AbstractInjectorPage {
     static boolean changed_gyro = false;
     static boolean changed_geo = false;
     
-    static String accelerometerData;
+    static String accelerationData;
        static String magneticData;
-       static String orientationData;
+       static String tiltData;
        static String gyroData;
        
-       static boolean orientation_active = true;
+       static boolean tilt_active = true;
     static boolean button_click = false;
     
        public Accelerometer(AbstractInjectorItem item, String name) {
@@ -100,12 +102,6 @@ public class Accelerometer extends AbstractInjectorPage {
                east = 5939.5;
                vertical = 43180.5;
        }
-
-       private void init() {
-               yawValue = 0;
-               pitchValue = -90;
-               rollValue = 0;
-       }
        
        @Override
        protected void createContents() {
@@ -132,8 +128,10 @@ public class Accelerometer extends AbstractInjectorPage {
                
                // Create composite containing moving type selection radio buttons
                Composite radioComposite = formUtil.createComposite(mobileComposite, 3);
+               gd = new GridData(SWT.CENTER, SWT.FILL, false, true);
+               radioComposite.setLayoutData(gd);
                
-               button01 = formUtil.createButton(radioComposite, "Yaw/Pitch", SWT.RADIO);
+               button01 = formUtil.createButton(radioComposite, "X/Z", SWT.RADIO);
                button01.setSelection(true);
                mode = Mode.YAW_PITCH;
                button01.addSelectionListener(new SelectionAdapter() {
@@ -143,7 +141,7 @@ public class Accelerometer extends AbstractInjectorPage {
                                super.widgetSelected(e);
                        }
                });
-               button02 = formUtil.createButton(radioComposite, "Roll/Pitch", SWT.RADIO);
+               button02 = formUtil.createButton(radioComposite, "X/Y", SWT.RADIO);
                button02.addSelectionListener(new SelectionAdapter() {
                        @Override
                        public void widgetSelected(SelectionEvent e) {
@@ -159,13 +157,30 @@ public class Accelerometer extends AbstractInjectorPage {
                                super.widgetSelected(e);
                        }
                });
+
+               Composite checkComposite = formUtil.createComposite(mobileComposite, 1);
+               gd = new GridData(SWT.CENTER, SWT.FILL, false, true);
+               checkComposite.setLayoutData(gd);
+               withAxisCheck = formUtil.createButton(checkComposite, "With axis", SWT.CHECK);
+               withAxisCheck.setSelection(false);
+               withAxisCheck.addSelectionListener(new SelectionAdapter() {
+               public void widgetSelected(SelectionEvent e) {
+                               if(withAxisCheck.getSelection())
+                                       panel.isWithAxis = true;
+                               else
+                                       panel.isWithAxis = false;
+                               super.widgetSelected(e);
+                       }
+           });
                
                // Create text (data output)
                
                dataText = new Text(mobileComposite, SWT.MULTI | SWT.BORDER );
-               gd = new GridData(GridData.FILL, GridData.CENTER, true, false);
+               dataText.setText("\n" + "\n" + "\n");
+               gd = new GridData(GridData.CENTER, GridData.CENTER, true, false);
+               gd.widthHint = 200;
                dataText.setLayoutData(gd);
-               
+               dataText.setEnabled(false);
                dataOutputTimer = new Timer(200, new ActionListener() {
             public void actionPerformed(ActionEvent evt) {
                if (PlatformUI.isWorkbenchRunning() == false){
@@ -180,115 +195,131 @@ public class Accelerometer extends AbstractInjectorPage {
                                        public void run() {
                                                DecimalFormat mf = new DecimalFormat("#0.00");
                                                Magnetic magnetic = Magnetic.getInstance();
+                                               double accelX = 0, accelY = 0, accelZ = 0;
+                                               double magneticX = 0, magneticY = 0, magneticZ = 0;
+                                               
+                                               accelX = panel.read_accelx/panel.g;
+                                               accelY = panel.read_accely/panel.g;
+                                               accelZ = panel.read_accelz/panel.g;
+                                               /* for convert (-0 or 1.8014523799287584E-15 etc.) to 0 */
+                                               if(accelX > -0.01 && accelX < 0.01) accelX = 0;
+                                               if(accelY > -0.01 && accelY < 0.01) accelY = 0;
+                                               if(accelZ > -0.01 && accelZ < 0.01) accelZ = 0;
+                                               
+                                               magneticX = magnetic.getReadCompassX();
+                                               magneticY = magnetic.getReadCompassY();
+                                               magneticZ = magnetic.getReadCompassZ();
+                                               /* for convert (-0 or 1.8014523799287584E-15 etc.) to 0 */
+                                               if(magneticX > -0.01 && magneticX < 0.01) magneticX = 0;
+                                               if(magneticY > -0.01 && magneticY < 0.01) magneticY = 0;
+                                               if(magneticZ > -0.01 && magneticZ < 0.01) magneticZ = 0;
                                                
-                                               if(checkboxAccelerometer.isDisposed())
+                                               if(checkboxAcceleration.isDisposed())
                                                {
                                                        dataOutputTimer.stop();
-                                                       accelerometerData = "accelerometer : Disable";
-                                                       orientationData = "orientation : Disable";
+                                                       accelerationData = "acceleration : Disable";
+                                                       tiltData = "tilt : Disable";
                                                }
                                                else
-                                               {
+                                               {                                                       
                                                        if(changed_accel == true){      
-                                                               if( checkboxAccelerometer.getSelection()){
-                                                                       accelerometerData = "accelerometer : " + mf.format(panel.read_accelx) + ", "+ mf.format(panel.read_accely) +
-                                                                       ", "+ mf.format(panel.read_accelz);
+                                                               if( checkboxAcceleration.getSelection()){
+                                                                       accelerationData = "Acceleration : " + mf.format(accelX) + ", "+ mf.format(accelY) +
+                                                                       ", "+ mf.format(accelZ);
                                                                }
                                                                else {
-                                                                       accelerometerData = "accelerometer : Disable";
-                                                                       orientationData = "orientation : Disable";
+                                                                       accelerationData = "Acceleration : Disable";
+                                                                       tiltData = "Tilt : Disable";
                                                                }
                                                                changed_accel = false;
                                                        }
-                                                       else if(!checkboxAccelerometer.getSelection())
+                                                       else if(!checkboxAcceleration.getSelection())
                                                        {
-                                                               accelerometerData = "accelerometer : Disable";
-                                                               orientationData = "orientation : Disable";
+                                                               accelerationData = "Acceleration : Disable";
+                                                               tiltData = "Tilt : Disable";
                                                        }
                                                        else
                                                        {
-                                                               accelerometerData = "accelerometer : " + mf.format(panel.read_accelx) + ", "+ mf.format(panel.read_accely) +
-                                                                               ", "+ mf.format(panel.read_accelz);
+                                                               accelerationData = "Acceleration : " + mf.format(accelX) + ", "+ mf.format(accelY) +
+                                                               ", "+ mf.format(accelZ);
                                                        }
                                                }
                                                
-                                               if(checkboxGeoMagnetic.isDisposed())
+                                               if(checkboxMagnetic.isDisposed())
                                                {
                                                        dataOutputTimer.stop();
-                                                       magneticData = "magnetic filed : Disable";
-                                                       orientationData = "orientation : Disable";
+                                                       magneticData = "Magnetic : Disable";
+                                                       tiltData = "Tilt : Disable";
                                                }
                                                else
                                                {
                                                        if(changed_geo == true){
-                                                               if( checkboxGeoMagnetic.getSelection()) {
-                                                                       magneticData = "magnetic filed : " + mf.format(magnetic.getReadCompassX()) +
-                                                                       ", " + mf.format(magnetic.getReadCompassY()) + ", " + mf.format(magnetic.getReadCompassZ());
+                                                               if( checkboxMagnetic.getSelection()) {
+                                                                       magneticData = "Magnetic : " + mf.format(magneticX) +
+                                                                       ", " + mf.format(magneticY) + ", " + mf.format(magneticZ);
                                                                        
-                                                                       if( checkboxOrientation.getSelection() ) {
-                                                                               orientationData = "orientation : " + mf.format(magnetic.getAzimuth()) +
+                                                                       if( checkboxTilt.getSelection() ) {
+                                                                               tiltData = "Tilt : " + mf.format(magnetic.getAzimuth()) +
                                                                                                ", " + mf.format(magnetic.getPitch()) + ", " + mf.format(magnetic.getRoll());
                                                                        }
                                                                        else
-                                                                               orientationData = "orientation : Disable";
+                                                                               tiltData = "Tilt : Disable";
                                                                }
                                                                else {
-                                                                       magneticData = "magnetic filed : Disable";
-                                                                       orientationData = "orientation : Disable";
+                                                                       magneticData = "Magnetic : Disable";
+                                                                       tiltData = "Tilt : Disable";
                                                                }
                                                                changed_geo = false;
                                                        }
-                                                       else if(!checkboxGeoMagnetic.getSelection())
+                                                       else if(!checkboxMagnetic.getSelection())
                                                        {
-                                                               magneticData = "magnetic filed : Disable";
-                                                               orientationData = "orientation : Disable";
+                                                               magneticData = "Magnetic : Disable";
+                                                               tiltData = "Tilt : Disable";
                                                        }
                                                        else
                                                        {
-                                                               magneticData = "magnetic filed : " + mf.format(magnetic.getReadCompassX()) +
-                                                                               ", " + mf.format(magnetic.getReadCompassY()) + ", " + mf.format(magnetic.getReadCompassZ());
+                                                               magneticData = "Magnetic : " + mf.format(magneticX) +
+                                                                               ", " + mf.format(magneticY) + ", " + mf.format(magneticZ);
                                                                                
-                                                               if( checkboxOrientation.getSelection() ) {
-                                                                       orientationData = "orientation : " + mf.format(magnetic.getAzimuth()) +
+                                                               if( checkboxTilt.getSelection() ) {
+                                                                       tiltData = "Tilt : " + mf.format(magnetic.getAzimuth()) +
                                                                                        ", " + mf.format(magnetic.getPitch()) + ", " + mf.format(magnetic.getRoll());
                                                                }
                                                                else
-                                                                       orientationData = "orientation : Disable";
+                                                                       tiltData = "Tilt : Disable";
                                                        }
                                                }
                                                
                                                if(checkboxGyro.isDisposed())
                                                {
                                                        dataOutputTimer.stop();
-                                                       gyroData = "gyroscope : Disable";
+                                                       gyroData = "Gyro : Disable";
                                                }
                                                else
                                                {
                                                        if(changed_gyro == true){
-                                                               
-                                                               
                                                                if( checkboxGyro.getSelection()) {
-                                                                       gyroData = "gyroscope : " + mf.format(panel.gyroPitch) + ", " + mf.format(panel.gyroRoll) + ", " + mf.format(panel.gyroYaw);
+                                                                       gyroData = "Gyro : " + mf.format(panel.gyroPitch) + ", " + mf.format(panel.gyroRoll) + ", " + mf.format(panel.gyroYaw);
                                                                }
                                                                else {
-                                                                       gyroData = "gyroscope : Disable";
+                                                                       gyroData = "Gyro : Disable";
                                                                }
                                                                changed_gyro = false;
                                                        }
                                                        else if(!checkboxGyro.getSelection())
                                                        {
-                                                               gyroData = "gyroscope : Disable";
+                                                               gyroData = "Gyro : Disable";
                                                        }
                                                        else
                                                        {
-                                                               gyroData = "gyroscope : " + mf.format(panel.gyroPitch) + ", " + mf.format(panel.gyroRoll) + ", " + mf.format(panel.gyroYaw);
+                                                               gyroData = "Gyro : " + mf.format(panel.gyroPitch) + ", " + mf.format(panel.gyroRoll) + ", " + mf.format(panel.gyroYaw);
                                                        }
                                                }
                                                
                                                if(dataText.isDisposed())
                                                        dataOutputTimer.stop();
                                                else
-                                                       dataText.setText(accelerometerData + "\n" + magneticData + "\n" +orientationData + "\n" + gyroData);
+                                                       dataText.setText(accelerationData + "\n" + magneticData + "\n" +tiltData + "\n" + gyroData);
                                        }
                });
             }
@@ -297,8 +328,11 @@ public class Accelerometer extends AbstractInjectorPage {
 
                // Create slider composite to add Yaw/Pitch/Roll sliders
                Composite sliderComposite = formUtil.createComposite(mainComposite, 2);    
-           
-           formUtil.createLabel(sliderComposite, "Pitch");
+               gd = new GridData(GridData.FILL, GridData.FILL, false, true);
+               gd.widthHint = 320;
+               sliderComposite.setLayoutData(gd);
+               
+           formUtil.createLabel(sliderComposite, "X :");
            pitchSlider = formUtil.createSlider(sliderComposite);
            setDefaultSlider(pitchSlider);
            pitchValue = (int) panel.pitchDegree;
@@ -310,7 +344,7 @@ public class Accelerometer extends AbstractInjectorPage {
                                pitchValue = pitchSlider.getSelection() - button_click_pitch;
                                panel.pitchDegree = pitchValue;
                                panel.repaint();
-                               
+
                                sendMessage(panel.read_accelx, panel.read_accely, panel.read_accelz);
                                
                                super.widgetSelected(e);
@@ -321,8 +355,8 @@ public class Accelerometer extends AbstractInjectorPage {
                                ((MobilePanel)panel).phone_pos_conv = true;
                        }
                });
-
-           formUtil.createLabel(sliderComposite, "Roll");    
+           
+           formUtil.createLabel(sliderComposite, "Y :");    
            rollSlider = formUtil.createSlider(sliderComposite);
            setDefaultSlider(rollSlider);
            rollValue = (int) panel.rollDegree;
@@ -346,7 +380,7 @@ public class Accelerometer extends AbstractInjectorPage {
                        }
                });
 
-               formUtil.createLabel(sliderComposite, "Yaw");
+               formUtil.createLabel(sliderComposite, "Z :");
                yawSlider = formUtil.createSlider(sliderComposite);
                setDefaultSlider(yawSlider);
                yawValue = (int) panel.yawDegree;
@@ -358,7 +392,9 @@ public class Accelerometer extends AbstractInjectorPage {
                                yawValue = yawSlider.getSelection() - button_click_yaw;
                                panel.yawDegree = yawValue;
                                panel.repaint();
+                               
                                sendMessage(panel.read_accelx, panel.read_accely, panel.read_accelz);
+                               
                                super.widgetSelected(e);
                        }
                });
@@ -369,8 +405,9 @@ public class Accelerometer extends AbstractInjectorPage {
                });
            
            // Create rotation button
-           Composite rotationComposite = formUtil.createComposite(sliderComposite, 4);
+           Composite rotationComposite = formUtil.createComposite(sliderComposite, 2);
            gd = new GridData(GridData.FILL, GridData.FILL, true, false);
+           gd.widthHint = 50;
            gd.horizontalSpan = 2;
            rotationComposite.setLayoutData(gd);
            createRotationButton(rotationComposite);
@@ -379,35 +416,40 @@ public class Accelerometer extends AbstractInjectorPage {
            // Create checkbox (Enable sensor)
            Composite checkboxComposite = formUtil.createComposite(sliderComposite, 2);
            GridData cbGd = new GridData(GridData.FILL, GridData.FILL, true, false);
+           gd.widthHint = 50;
            cbGd.horizontalSpan = 2;
            checkboxComposite.setLayoutData(cbGd);
-           checkboxAccelerometer = formUtil.createButton(checkboxComposite, "Accelerometer sensor", SWT.CHECK);
-           checkboxGeoMagnetic = formUtil.createButton(checkboxComposite, "Geomagnetic sensor", SWT.CHECK);
-           checkboxGyro = formUtil.createButton(checkboxComposite, "Gyroscope sensor", SWT.CHECK);
-           checkboxOrientation = formUtil.createButton(checkboxComposite, "Orientation sensor", SWT.CHECK);
-           checkboxAccelerometer.setSelection(true);
-           checkboxGeoMagnetic.setSelection(true);
+           checkboxAcceleration = formUtil.createButton(checkboxComposite, "Acceleration sensor", SWT.CHECK);
+           checkboxMagnetic = formUtil.createButton(checkboxComposite, "Magnetic sensor", SWT.CHECK);
+           checkboxTilt = formUtil.createButton(checkboxComposite, "Tilt sensor", SWT.CHECK);
+           checkboxGyro = formUtil.createButton(checkboxComposite, "Gyro sensor", SWT.CHECK);
+           checkboxAcceleration.setSelection(true);
+           checkboxMagnetic.setSelection(true);
            checkboxGyro.setSelection(true);
-           checkboxOrientation.setSelection(true);
-           checkboxAccelerometer.addSelectionListener(new SelectionAdapter() {
+           checkboxTilt.setSelection(true);
+           checkboxAcceleration.setVisible(false);
+           checkboxMagnetic.setVisible(false);
+           checkboxGyro.setVisible(false);
+           checkboxTilt.setVisible(false);
+           checkboxAcceleration.addSelectionListener(new SelectionAdapter() {
                public void widgetSelected(SelectionEvent e) {
-                               panel.accelerometerTimer(checkboxAccelerometer.getSelection());
-                               if(!checkboxAccelerometer.getSelection())
+                               panel.accelerometerTimer(checkboxAcceleration.getSelection());
+                               if(!checkboxAcceleration.getSelection())
                                {       
-                                       checkboxOrientation.setSelection(false);
-                                       orientation_active = false;
+                                       checkboxTilt.setSelection(false);
+                                       tilt_active = false;
                                }
                                super.widgetSelected(e);
                        }
                
            });
-           checkboxGeoMagnetic.addSelectionListener(new SelectionAdapter() {
+           checkboxMagnetic.addSelectionListener(new SelectionAdapter() {
                public void widgetSelected(SelectionEvent e) {
-                               panel.geomagneticTimer(checkboxGeoMagnetic.getSelection());
-                               if(!checkboxGeoMagnetic.getSelection())
+                               panel.geomagneticTimer(checkboxMagnetic.getSelection());
+                               if(!checkboxMagnetic.getSelection())
                                {
-                                       checkboxOrientation.setSelection(false);
-                                       orientation_active = false;
+                                       checkboxTilt.setSelection(false);
+                                       tilt_active = false;
                                }
                                super.widgetSelected(e);
                        }
@@ -418,18 +460,18 @@ public class Accelerometer extends AbstractInjectorPage {
                                super.widgetSelected(e);
                        }
            });
-           checkboxOrientation.addSelectionListener(new SelectionAdapter() {
+           checkboxTilt.addSelectionListener(new SelectionAdapter() {
                public void widgetSelected(SelectionEvent e) {
-                               if(checkboxOrientation.getSelection())
+                               if(checkboxTilt.getSelection())
                                {
-                                       checkboxAccelerometer.setSelection(true);
-                                       panel.accelerometerTimer(checkboxAccelerometer.getSelection());
-                                       checkboxGeoMagnetic.setSelection(true);
-                                       panel.geomagneticTimer(checkboxGeoMagnetic.getSelection());
-                                       orientation_active = true;
+                                       checkboxAcceleration.setSelection(true);
+                                       panel.accelerometerTimer(checkboxAcceleration.getSelection());
+                                       checkboxMagnetic.setSelection(true);
+                                       panel.geomagneticTimer(checkboxMagnetic.getSelection());
+                                       tilt_active = true;
                                }
                                else
-                                       orientation_active = false;
+                                       tilt_active = false;
                                super.widgetSelected(e);
                        }
            });
@@ -470,7 +512,7 @@ public class Accelerometer extends AbstractInjectorPage {
        
        private void createRotationButton( Composite rotationComposite){
                Composite buttonComposite = formUtil.createComposite(rotationComposite);
-               buttonComposite.setLayout(new GridLayout(4, true));
+               buttonComposite.setLayout(new GridLayout(2, true));
                Button rotation0 = formUtil.createButton(buttonComposite, "Portrait", SWT.PUSH);
                rotation0.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
            Button rotation90 = formUtil.createButton(buttonComposite, "Landscape", SWT.PUSH);
@@ -735,26 +777,32 @@ public class Accelerometer extends AbstractInjectorPage {
        }
        
        public void sendMessage(double x, double y, double z) {
-               TestSensorMessage msg = new TestSensorMessage(x, y, z);
+               // 2012/09/14 - for change criteria from SensorFW
+               TestSensorMessage msg = new TestSensorMessage(-x, -y, -z);
                
                try {
                //      sensorSocket.send(msg.getMessage());
                        injectorSocket.sendSensor(msg.getMessage());
+               } catch (IOException e1) {
+                       e1.printStackTrace();
                } catch (Exception e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
                }
        }
        public void sendMessage(String sensorNumber, double x, double y, double z) {
-               if(sensorNumber == "1\n")       // accel
+               if(sensorNumber == SensorConstants.ACCEL_ID)    // accel
                {
                        if(button_click == true || tmp_accel_x != x || tmp_accel_y != y || tmp_accel_z != z)
                        {
-                               TestSensorMessage msg = new TestSensorMessage(x, y, z);
+                               // 2012/09/14 - for change criteria from SensorFW
+                               TestSensorMessage msg = new TestSensorMessage(-x, -y, -z);
                                
                                try {
                                //      sensorSocket.send(sensorNumber + msg.getMessage());
                                        injectorSocket.sendSensor(sensorNumber + msg.getMessage());
+                               } catch (IOException e1) {
+                                       e1.printStackTrace();
                                } catch (Exception e1) {
                                        // TODO Auto-generated catch block
                                        e1.printStackTrace();
@@ -767,15 +815,17 @@ public class Accelerometer extends AbstractInjectorPage {
                                changed_accel = true;
                        }
                }
-               else if(sensorNumber == "4\n")  // gyro
+               else if(sensorNumber == SensorConstants.GYRO_ID)        // gyro
                {
                        if(tmp_gyro_x != x || tmp_gyro_y != y || tmp_gyro_z != z)
                        {
-                               TestSensorMessage msg = new TestSensorMessage(x, y, z);
+                               TestSensorMessage msg = new TestSensorMessage(x * 1000, y * 1000, z * 1000);
                                
                                try {
                                //      sensorSocket.send(sensorNumber + msg.getMessage());
                                        injectorSocket.sendSensor(sensorNumber + msg.getMessage());
+                               } catch (IOException e1) {
+                                       e1.printStackTrace();
                                } catch (Exception e1) {
                                        // TODO Auto-generated catch block
                                        e1.printStackTrace();
@@ -789,7 +839,7 @@ public class Accelerometer extends AbstractInjectorPage {
                }
        }
        public void sendMessage(String sensorNumber, double x, double y, double z, double a, double b, double c, double d) {
-               if(sensorNumber == "5\n")
+               if(sensorNumber == SensorConstants.GEO_ID)
                {
                        if(tmp_geo_x != x || tmp_geo_y != y || tmp_geo_z != z || tmp_geo_a != a || tmp_geo_b != b || tmp_geo_c != c || tmp_geo_d != d)
                        {
@@ -798,6 +848,8 @@ public class Accelerometer extends AbstractInjectorPage {
                                try {
                                //      sensorSocket.send(sensorNumber + msg.getMessage());
                                        injectorSocket.sendSensor(sensorNumber + msg.getMessage());
+                               } catch (IOException e1) {
+                                       e1.printStackTrace();
                                } catch (Exception e1) {
                                        // TODO Auto-generated catch block
                                        e1.printStackTrace();
diff --git a/org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/accelerometer/page/ManualInputAccel.java b/org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/accelerometer/page/ManualInputAccel.java
new file mode 100644 (file)
index 0000000..6e0a716
--- /dev/null
@@ -0,0 +1,643 @@
+/*
+ * org.tizen.injector.sensor.accelerometer
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.sensor.accelerometer.page;
+
+import java.io.File;
+import java.io.IOException;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Slider;
+import org.eclipse.swt.widgets.Text;
+import org.tizen.common.connection.ConnectionPlugin;
+import org.tizen.injector.InjectorDialog;
+import org.tizen.injector.control.TableViewContentProvider;
+import org.tizen.injector.control.TableViewLabelProvider;
+import org.tizen.injector.model.DefaultTableModel;
+import org.tizen.injector.protocol.sensor.TestSensorMessage;
+import org.tizen.injector.provider.AbstractInjectorItem;
+import org.tizen.injector.provider.AbstractInjectorPage;
+import org.tizen.injector.sensor.accelerometer.FileListVO;
+import org.tizen.injector.sensor.accelerometer.SensorConstants;
+import org.tizen.sdblib.IDevice;
+import org.tizen.sdblib.service.SyncResult;
+import org.tizen.sdblib.service.SyncService;
+
+public class ManualInputAccel extends AbstractInjectorPage {
+       private String logFileName = null;
+       private String remoteFilePath = "/opt/sensor/accel/InputFiles/";
+       Slider accel_xSlider, accel_ySlider, accel_zSlider;
+       private Text accel_xText, accel_yText, accel_zText;
+       double accel_xValue, accel_yValue, accel_zValue;
+       double g = 9.80665;
+       int accel_forSliderVal = 200;
+       DecimalFormat df = new DecimalFormat("0.##");
+       
+       private Text filenameText, repeatText;  
+       private Button startButton, stopButton, deleteButton;
+       private Button addButton;
+       
+       private TableViewer viewer;
+       private DefaultTableModel model = new DefaultTableModel(new FileListVO());
+       private ArrayList<TableViewer> viewerList = new ArrayList<TableViewer>();
+       public int repeatCount = 1, fileCnt = 0;
+       
+       public ManualInputAccel(AbstractInjectorItem item, String name) {
+               super(item, name);
+
+       }
+
+       private void reset() {
+               accel_xValue = 0;
+               accel_xSlider.setSelection(accel_forSliderVal);
+               accel_xText.setText(df.format(accel_xValue));
+               
+               accel_yValue = 0;
+               accel_ySlider.setSelection(accel_forSliderVal);
+               accel_yText.setText(df.format(accel_yValue));
+               
+               accel_zValue = 0;
+               accel_zSlider.setSelection(accel_forSliderVal);
+               accel_zText.setText(df.format(accel_zValue));
+       }
+       
+       private void createAccel() {
+               Composite client = formUtil.createSection(parent, "Acceleration");
+               int maxSliderVal = 401;
+               
+               // X
+               Composite mainComposite = formUtil.createComposite(client, 4);
+               GridData gd = new GridData(GridData.FILL, GridData.FILL, false, true);
+               gd.widthHint = 560;
+               mainComposite.setLayoutData(gd);
+               
+               formUtil.createLabel(mainComposite, "X : ");
+               accel_xSlider = formUtil.createSlider(mainComposite);
+               gd = new GridData(SWT.NONE, SWT.CENTER, false, true);
+               gd.widthHint = 460;
+               accel_xSlider.setLayoutData(gd);
+           setDefaultSlider(accel_xSlider, maxSliderVal);
+           accel_xSlider.setSelection(accel_forSliderVal);
+           accel_xSlider.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               int xData;
+                               xData = accel_xSlider.getSelection() - accel_forSliderVal;
+                               accel_xValue = xData*0.01;
+                               accel_xText.setText(df.format(accel_xValue));
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+           });
+                   
+               accel_xValue = accel_xSlider.getSelection() - accel_forSliderVal;
+               accel_xText = formUtil.createText(mainComposite, df.format(accel_xValue));
+               gd = new GridData(SWT.NONE, SWT.FILL, false, true);
+               gd.widthHint = 30;
+               accel_xText.setLayoutData(gd);
+               accel_xText.setTextLimit(5);
+               accel_xText.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               int xData;
+                               String number = accel_xText.getText().trim();
+                               if(number==null||number.length()==0)
+                                       return;
+                               
+                               try {
+                                       if(!isNumeric(number) || Double.parseDouble(number) < -2 || Double.parseDouble(number) > 2)
+                                                       throw null;
+                               } catch (NumberFormatException err) {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter the correct value.\nX value can be entered in the range of -2 to 2.");
+                                       accel_xText.setText(df.format(accel_xValue));
+                                       return;
+                               } catch (Exception err) {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter the correct value.\nX value can be entered in the range of -2 to 2.");
+                                       accel_xText.setText(df.format(accel_xValue));
+                                       return;
+                               }
+                               
+                               accel_xValue = Double.parseDouble(number);
+                               xData = (int)(Double.parseDouble(number) * 100 + accel_forSliderVal);
+                               accel_xSlider.setSelection(xData);
+                       }
+               });
+               
+               formUtil.createLabel(mainComposite, "[g]");
+               
+               // Y
+               formUtil.createLabel(mainComposite, "Y : ");
+               accel_ySlider = formUtil.createSlider(mainComposite);
+           setDefaultSlider(accel_ySlider, maxSliderVal);
+           gd = new GridData(SWT.NONE, SWT.CENTER, false, true);
+               gd.widthHint = 460;
+               accel_ySlider.setLayoutData(gd);
+           accel_ySlider.setSelection(accel_forSliderVal);
+           accel_ySlider.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               int yData;
+                               yData = accel_ySlider.getSelection() - accel_forSliderVal;
+                               accel_yValue = yData*0.01;
+                               accel_yText.setText(df.format(accel_yValue));
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+           });
+                   
+               accel_yValue = accel_ySlider.getSelection() - accel_forSliderVal;
+               accel_yText = formUtil.createText(mainComposite, df.format(accel_yValue));
+               gd = new GridData(SWT.NONE, SWT.FILL, false, true);
+               gd.widthHint = 30;
+               accel_yText.setLayoutData(gd);
+               accel_yText.addSelectionListener(new SelectionAdapter() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               int yData;
+                               String number = accel_yText.getText().trim();
+                               if(number==null||number.length()==0)
+                                       return;
+                               
+                               try {
+                                       if(!isNumeric(number) || Double.parseDouble(number) < -2 || Double.parseDouble(number) > 2)
+                                               throw null;
+                               } catch (NumberFormatException err) {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter the correct value.\nY value can be entered in the range of -2 to 2.");
+                                       accel_yText.setText(df.format(accel_yValue));
+                                       return;
+                               } catch (Exception err) {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter the correct value.\nY value can be entered in the range of -2 to 2.");
+                                       accel_yText.setText(df.format(accel_yValue));
+                                       return;
+                               }
+                               
+                               accel_yValue = Double.parseDouble(number);
+                               yData = (int)(Double.parseDouble(number) * 100 + accel_forSliderVal);
+                               accel_ySlider.setSelection(yData);
+                       }
+               });
+               
+               accel_yText.setTextLimit(5);
+               formUtil.createLabel(mainComposite, "[g]");
+               
+               // Z
+               formUtil.createLabel(mainComposite, "Z : ");
+               accel_zSlider = formUtil.createSlider(mainComposite);
+           setDefaultSlider(accel_zSlider, maxSliderVal);
+           gd = new GridData(SWT.NONE, SWT.CENTER, false, true);
+               gd.widthHint = 460;
+               accel_zSlider.setLayoutData(gd);
+           accel_zSlider.setSelection(accel_forSliderVal);
+           accel_zSlider.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               int zData;
+                               zData = accel_zSlider.getSelection() - accel_forSliderVal;
+                               accel_zValue = zData*0.01;
+                               accel_zText.setText(df.format(accel_zValue));
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+           });
+                 
+               accel_zValue = accel_zSlider.getSelection() - accel_forSliderVal;
+               accel_zText = formUtil.createText(mainComposite, df.format(accel_zValue));
+               gd = new GridData(SWT.NONE, SWT.FILL, false, true);
+               gd.widthHint = 30;
+               accel_zText.setLayoutData(gd);
+               accel_zText.addSelectionListener(new SelectionAdapter() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               int zData;
+                               String number = accel_zText.getText().trim();
+                               if(number==null||number.length()==0)
+                                       return;
+                               
+                               try {
+                                       if(!isNumeric(number) || Double.parseDouble(number) < -2 || Double.parseDouble(number) > 2)
+                                               throw null;
+                               } catch (NumberFormatException err) {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter the correct value.\nZ value can be entered in the range of -2 to 2.");
+                                       accel_zText.setText(df.format(accel_zValue));
+                                       return;
+                               } catch (Exception err) {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter the correct value.\nZ value can be entered in the range of -2 to 2.");
+                                       accel_zText.setText(df.format(accel_zValue));
+                                       return;
+                               }
+                               
+                               accel_zValue = Double.parseDouble(number);
+                               zData = (int)(Double.parseDouble(number) * 100 + accel_forSliderVal);
+                               accel_zSlider.setSelection(zData);
+                       }
+               });
+               accel_zText.setTextLimit(5);
+               formUtil.createLabel(mainComposite, "[g]");
+               
+               Composite subComposite = formUtil.createComposite(client, 2);
+               Button resetButton = formUtil.createButton(subComposite, "Reset", SWT.PUSH);
+               gd = new GridData(SWT.NONE, SWT.FILL, false, true);
+               gd.widthHint = 100;
+               resetButton.setLayoutData(gd);
+               
+               resetButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               reset();
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
+               
+               Button sendButton = formUtil.createButton(subComposite, "Send", SWT.PUSH);
+               gd = new GridData(SWT.NONE, SWT.FILL, false, true);
+               gd.widthHint = 100;
+               sendButton.setLayoutData(gd);
+               
+               sendButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               sendMessage();
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
+               
+/////////////////// File Input ////////////////////////////////////
+               
+               Composite client2 = formUtil.createSection(parent, "File input");
+               Composite fileComposite = formUtil.createComposite(client2, 4);
+               gd = new GridData(GridData.FILL, GridData.FILL, false, true);
+               gd.widthHint = 560;
+               fileComposite.setLayoutData(gd);
+               filenameText = formUtil.createText(fileComposite, "");
+               gd = new GridData(SWT.NONE, SWT.NONE, false, true);
+               gd.widthHint = 320;
+               filenameText.setLayoutData(gd);
+               filenameText.setEditable(false);
+               Button browserButton = formUtil.createButton(fileComposite, "Browse", SWT.PUSH);
+               gd = new GridData(SWT.NONE, SWT.NONE, false, true);
+               gd.widthHint = 100;
+               browserButton.setLayoutData(gd);
+               browserButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               String filename = "";
+                               FileDialog dialog = new FileDialog(new Shell());
+                               filename = dialog.open();
+                               
+                               if(filename == null)
+                                       return;
+                               
+                               filenameText.setText(filename);
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
+               
+               addButton = formUtil.createButton(fileComposite, "Add", SWT.PUSH);
+               gd = new GridData(SWT.NONE, SWT.NONE, false, true);
+               gd.widthHint = 100;
+               addButton.setLayoutData(gd);
+               addButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               if(model.size() == 5)
+                               {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "The maximum number of files is 5.");
+                                       return;
+                               }
+                               
+                               FileListVO fl = new FileListVO();
+                               fl.setNum(++fileCnt);
+                               fl.setFilePath(filenameText.getText());
+                               model.add(fl);
+                               viewer.refresh();
+                               
+                               startButton.setEnabled(true);
+                               deleteButton.setEnabled(true);
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
+               
+               Composite listComposite = formUtil.createComposite(client2, 1);
+               String[] columnNames = {
+                               "No.",
+                               "File path"     
+               };
+               
+               viewer = formUtil.createTableViewer(listComposite, columnNames);
+               gd = new GridData(SWT.NONE, SWT.NONE, false, true);
+               gd.widthHint = 540;
+               gd.heightHint = 76;
+               viewer.getControl().setLayoutData(gd);
+               
+               viewer.setContentProvider(new TableViewContentProvider());
+               viewer.setLabelProvider(new TableViewLabelProvider(viewer));
+               viewer.setInput(model);
+               
+               Composite fileComposite2 = formUtil.createComposite(client2, 8);
+               formUtil.createLabel(fileComposite2, "Repeat : ");
+               
+               Button leftButton = formUtil.createButton(fileComposite2, "<", SWT.PUSH);
+               leftButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               if(repeatCount != 1)
+                                       repeatCount -= 1;
+                               
+                               repeatText.setText(String.format("%d", repeatCount));
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub      
+                       }
+               });
+               
+               repeatText = formUtil.createText(fileComposite2, String.format("%d", repeatCount));
+               gd = new GridData(SWT.NONE, SWT.NONE, false, true);
+               gd.widthHint = 8;
+               repeatText.setLayoutData(gd);
+               repeatText.setEditable(false);
+               
+               Button rightButton = formUtil.createButton(fileComposite2, ">", SWT.PUSH);
+               rightButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               if(repeatCount != 9)
+                                       repeatCount += 1;
+                               
+                               repeatText.setText(String.format("%d", repeatCount));
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
+               
+               formUtil.createLabel(fileComposite2, " ");
+               
+               startButton = formUtil.createButton(fileComposite2, "Start", SWT.PUSH);
+               gd = new GridData(SWT.NONE, SWT.NONE, false, true);
+               gd.widthHint = 100;
+               startButton.setLayoutData(gd);
+               startButton.setEnabled(false);
+               startButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               // PUSH FILE TO EMULATOR
+                               Object[] obj = model.getDatas();
+                               String files = "";
+                               for(int i = 0; i < model.size(); i++)
+                               {
+                                       FileListVO fl = (FileListVO)obj[i];
+                                       File file = new File(fl.getFilePath());
+                                       if (file.exists()) {
+                                               @SuppressWarnings("unused")
+                                               SyncResult result;
+                                               try {
+                                                       IDevice device = ConnectionPlugin.getDefault().getCurrentDevice();
+                                                       SyncService sync = device.getSyncService();
+                                                       if (sync != null)
+                                                       {
+                                                               logFileName = file.getName();
+                                                               files += logFileName + "\n";
+                                                               result = sync.push(file.getPath(), device.getFileEntry( remoteFilePath ) );// Fixxed
+                                                       }
+                                               } catch (IOException e1) {
+                                                       e1.printStackTrace();
+                                               } catch (Exception e1) {
+                                                       // TODO Auto-generated catch block
+                                                       e1.printStackTrace();
+                                               }
+                                       }
+                               }
+                               
+                               startButton.setEnabled(false);
+                               stopButton.setEnabled(true);
+                               deleteButton.setEnabled(false);
+                               addButton.setEnabled(false);
+                               sendFileMessage(files);
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
+               
+               stopButton = formUtil.createButton(fileComposite2, "Stop", SWT.PUSH);
+               gd = new GridData(SWT.NONE, SWT.NONE, false, true);
+               gd.widthHint = 100;
+               stopButton.setLayoutData(gd);
+               stopButton.setEnabled(false);
+               stopButton.addSelectionListener(new SelectionListener () {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               sendFileStop();
+                               stopButton.setEnabled(false);
+                               startButton.setEnabled(true);
+                               deleteButton.setEnabled(true);
+                               addButton.setEnabled(true);
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
+               
+               deleteButton = formUtil.createButton(fileComposite2, "Delete", SWT.PUSH);
+               gd = new GridData(SWT.NONE, SWT.NONE, false, true);
+               gd.widthHint = 100;
+               deleteButton.setLayoutData(gd);
+               deleteButton.setEnabled(false);
+               deleteButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               IStructuredSelection selection = (IStructuredSelection)viewer.getSelection();
+                               Object [] objs = selection.toArray();
+                               for (int i = 0; i < objs.length; i++) 
+                               {
+                                       FileListVO fl = ((FileListVO)objs[i]);
+                                       model.remove(fl);
+                                       fileCnt--;
+                               }
+                               
+                               Object[] obj = model.getDatas();
+                               for (int i = 0; i < model.size(); i++)
+                               {
+                                       FileListVO fl = (FileListVO)obj[i];
+                                       fl.setNum(i+1);
+                               }
+                               
+                               viewer.refresh();
+                               
+                               if(fileCnt == 0)
+                               {
+                                       startButton.setEnabled(false);
+                                       deleteButton.setEnabled(false);
+                               }
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
+       }
+       
+       public void addViewer(TableViewer viewer){
+               viewerList.add(viewer);
+       }
+       
+       public void refresh(){
+               for(int i=1;i<viewerList.size();i++){
+                       viewerList.get(i).refresh();
+               }
+       }
+       
+       @Override
+       protected void createContents() {
+               createAccel();
+       }
+       
+       public static boolean isNumeric(String str) {   
+               return str.matches("-?\\d+(.\\d+)?"); 
+       } 
+
+       @Override
+       protected void registerReceivers() {
+               // TODO Auto-generated method stub
+
+       }
+       
+       private void setDefaultSlider(Slider slider, int max) {
+           slider.setMinimum(0);
+           slider.setMaximum(max);
+           slider.setIncrement(1);
+           slider.setThumb(1);
+       }
+       
+       public void sendMessage() {
+               accel_xValue = Double.parseDouble(accel_xText.getText());
+               accel_yValue = Double.parseDouble(accel_yText.getText());
+               accel_zValue = Double.parseDouble(accel_zText.getText());
+               TestSensorMessage msg = new TestSensorMessage(accel_xValue * g, accel_yValue * g, accel_zValue * g);
+               
+               try {
+                       injectorSocket.sendSensor(SensorConstants.ACCEL_ID + msg.getMessage());
+               } catch (IOException e1) {
+                       e1.printStackTrace();
+               } catch (Exception e1) {
+                       // TODO Auto-generated catch block
+                       e1.printStackTrace();
+               }
+       }
+       
+       public void sendFileMessage(String files) {
+               String msg = String.format("%d\n%d\n%s", repeatCount, fileCnt, files);
+               try {
+                       injectorSocket.sendSensor(SensorConstants.FILE_ACCEL_ID + msg);
+               } catch (IOException e1) {
+                       e1.printStackTrace();
+               } catch (Exception e1) {
+                       // TODO Auto-generated catch block
+                       e1.printStackTrace();
+               }
+       }
+       
+       public void sendFileStop() {
+               String msg = String.format("0\n");
+               try {
+                       injectorSocket.sendSensor(SensorConstants.FILE_ACCEL_ID + msg);
+               } catch (IOException e1) {
+                       e1.printStackTrace();
+               } catch (Exception e1) {
+                       // TODO Auto-generated catch block
+                       e1.printStackTrace();
+               }
+       }
+}
diff --git a/org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/accelerometer/page/ManualInputGyro.java b/org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/accelerometer/page/ManualInputGyro.java
new file mode 100644 (file)
index 0000000..834dd98
--- /dev/null
@@ -0,0 +1,643 @@
+/*
+ * org.tizen.injector.sensor.accelerometer
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.sensor.accelerometer.page;
+
+import java.io.File;
+import java.io.IOException;
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Slider;
+import org.eclipse.swt.widgets.Text;
+import org.tizen.common.connection.ConnectionPlugin;
+import org.tizen.injector.InjectorDialog;
+import org.tizen.injector.control.TableViewContentProvider;
+import org.tizen.injector.control.TableViewLabelProvider;
+import org.tizen.injector.model.DefaultTableModel;
+import org.tizen.injector.protocol.sensor.TestSensorMessage;
+import org.tizen.injector.provider.AbstractInjectorItem;
+import org.tizen.injector.provider.AbstractInjectorPage;
+import org.tizen.injector.sensor.accelerometer.FileListVO;
+import org.tizen.injector.sensor.accelerometer.SensorConstants;
+import org.tizen.sdblib.IDevice;
+import org.tizen.sdblib.service.SyncService;
+
+public class ManualInputGyro extends AbstractInjectorPage {
+       private String logFileName = null;
+       private String remoteFilePath = "/opt/sensor/gyro/InputFiles/";
+       Slider gyro_xSlider, gyro_ySlider, gyro_zSlider;
+       private Text gyro_xText, gyro_yText, gyro_zText;
+       double gyro_xValue, gyro_yValue, gyro_zValue;
+       int gyro_forSliderVal = 1000;
+       DecimalFormat df = new DecimalFormat("0.##");
+       
+       private Text filenameText, repeatText;  
+       private Button startButton, stopButton, deleteButton;
+       private Button addButton;
+       
+       private TableViewer viewer;
+       private DefaultTableModel model = new DefaultTableModel(new FileListVO());
+       private ArrayList<TableViewer> viewerList = new ArrayList<TableViewer>();
+       public int repeatCount = 1, fileCnt = 0;
+       
+       public ManualInputGyro(AbstractInjectorItem item, String name) {
+               super(item, name);
+
+       }
+       
+       private void reset() {
+               gyro_xValue = 0;
+               gyro_xSlider.setSelection(gyro_forSliderVal);
+               gyro_xText.setText(df.format(gyro_xValue));
+               
+               gyro_yValue = 0;
+               gyro_ySlider.setSelection(gyro_forSliderVal);
+               gyro_yText.setText(df.format(gyro_yValue));
+               
+               gyro_zValue = 0;
+               gyro_zSlider.setSelection(gyro_forSliderVal);
+               gyro_zText.setText(df.format(gyro_zValue));
+       }
+       
+       private void createGyro() {
+               Composite client = formUtil.createSection(parent, "Gyro");
+               int maxSliderVal = 2001;
+               
+               // X
+               Composite mainComposite = formUtil.createComposite(client, 4);
+               GridData gd = new GridData(SWT.NONE, SWT.FILL, false, true);
+               gd.widthHint = 580;
+               mainComposite.setLayoutData(gd);
+               
+               formUtil.createLabel(mainComposite, "X : ");
+               gyro_xSlider = formUtil.createSlider(mainComposite);
+           setDefaultSlider(gyro_xSlider, maxSliderVal);
+           gd = new GridData(SWT.NONE, SWT.CENTER, false, true);
+               gd.widthHint = 380;
+               gyro_xSlider.setLayoutData(gd);
+           gyro_xSlider.setSelection(gyro_forSliderVal);
+           gyro_xSlider.addSelectionListener(new SelectionListener() {
+
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               int xData;
+                               xData = gyro_xSlider.getSelection() - gyro_forSliderVal;
+                               gyro_xValue = xData*0.01;
+                               gyro_xText.setText(df.format(gyro_xValue));
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+           });
+                   
+           gyro_xValue = gyro_xSlider.getSelection() - gyro_forSliderVal;
+               gyro_xText = formUtil.createText(mainComposite, df.format(gyro_xValue));
+               gd = new GridData(SWT.NONE, SWT.FILL, false, true);
+               gd.widthHint = 30;
+               gyro_xText.setLayoutData(gd);
+               gyro_xText.setTextLimit(5);
+               gyro_xText.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               int xData;
+                               String number = gyro_xText.getText().trim();
+                               if(number==null||number.length()==0)
+                                       return;
+                               
+                               try {
+                                       if(!isNumeric(number) || Double.parseDouble(number) < -10 || Double.parseDouble(number) > 10)
+                                               throw null;
+                               } catch (NumberFormatException err) {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter the correct value.\nX value can be entered in the range of -10 to 10.");
+                                       gyro_xText.setText(df.format(gyro_xValue));
+                                       return;
+                               } catch (Exception err) {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter the correct value.\nX value can be entered in the range of -10 to 10.");
+                                       gyro_xText.setText(df.format(gyro_xValue));
+                                       return;
+                               }
+                               
+                               gyro_xValue = Double.parseDouble(number);
+                               xData = (int)(Double.parseDouble(number) * 100 + gyro_forSliderVal);
+                               gyro_xSlider.setSelection(xData);
+                       }
+               });
+               formUtil.createLabel(mainComposite, "[radians/second]");
+               
+               // Y
+               formUtil.createLabel(mainComposite, "Y : ");
+               gyro_ySlider = formUtil.createSlider(mainComposite);
+           setDefaultSlider(gyro_ySlider, maxSliderVal);
+           gd = new GridData(SWT.NONE, SWT.CENTER, false, true);
+               gd.widthHint = 380;
+               gyro_ySlider.setLayoutData(gd);
+           gyro_ySlider.setSelection(gyro_forSliderVal);
+           gyro_ySlider.addSelectionListener(new SelectionListener() {
+
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               int yData;
+                               yData = gyro_ySlider.getSelection() - gyro_forSliderVal;
+                               gyro_yValue = yData*0.01;
+                               gyro_yText.setText(df.format(gyro_yValue));
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+           });
+                   
+               gyro_yValue = gyro_ySlider.getSelection() - gyro_forSliderVal;
+               gyro_yText = formUtil.createText(mainComposite, df.format(gyro_yValue));
+               gd = new GridData(SWT.NONE, SWT.FILL, false, true);
+               gd.widthHint = 30;
+               gyro_yText.setLayoutData(gd);
+               gyro_yText.setTextLimit(5);
+               gyro_yText.addSelectionListener(new SelectionAdapter() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               int yData;
+                               String number = gyro_yText.getText().trim();
+                               if(number==null||number.length()==0)
+                                       return;
+                               
+                               try {
+                                       if(!isNumeric(number) || Double.parseDouble(number) < -10 || Double.parseDouble(number) > 10)
+                                               throw null;
+                               } catch (NumberFormatException err) {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter the correct value.\nX value can be entered in the range of -10 to 10.");
+                                       gyro_xText.setText(df.format(gyro_xValue));
+                                       return;
+                               } catch (Exception err) {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter the correct value.\nY value can be entered in the range of -10 to 10.");
+                                       gyro_yText.setText(df.format(gyro_yValue));
+                                       return;
+                               }
+                               
+                               gyro_yValue = Double.parseDouble(number);
+                               yData = (int)(Double.parseDouble(number) * 100 + gyro_forSliderVal);
+                               gyro_ySlider.setSelection(yData);
+                       }
+               });
+               
+               formUtil.createLabel(mainComposite, "[radians/second]");
+               
+               // Z
+               formUtil.createLabel(mainComposite, "Z : ");
+               gyro_zSlider = formUtil.createSlider(mainComposite);
+           setDefaultSlider(gyro_zSlider, maxSliderVal);
+           gd = new GridData(SWT.NONE, SWT.CENTER, false, true);
+               gd.widthHint = 380;
+               gyro_zSlider.setLayoutData(gd);
+           gyro_zSlider.setSelection(gyro_forSliderVal);
+           gyro_zSlider.addSelectionListener(new SelectionListener() {
+
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               int zData;
+                               zData = gyro_zSlider.getSelection() - gyro_forSliderVal;
+                               gyro_zValue = zData*0.01;
+                               gyro_zText.setText(df.format(gyro_zValue));
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+           });
+                 
+           gyro_zValue = gyro_zSlider.getSelection() - gyro_forSliderVal;
+               gyro_zText = formUtil.createText(mainComposite, df.format(gyro_zValue));
+               gd = new GridData(SWT.NONE, SWT.FILL, false, true);
+               gd.widthHint = 30;
+               gyro_zText.setLayoutData(gd);
+               gyro_zText.setTextLimit(5);
+               gyro_zText.addSelectionListener(new SelectionAdapter() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               int zData;
+                               String number = gyro_zText.getText().trim();
+                               if(number==null||number.length()==0)
+                                       return;
+                               
+                               try {
+                                       if(!isNumeric(number) || Double.parseDouble(number) < -10 || Double.parseDouble(number) > 10)
+                                               throw null;
+                               } catch (NumberFormatException err) {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter the correct value.\nX value can be entered in the range of -10 to 10.");
+                                       gyro_xText.setText(df.format(gyro_xValue));
+                                       return;
+                               } catch (Exception err) {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter the correct value.\nZ value can be entered in the range of -10 to 10.");
+                                       gyro_zText.setText(df.format(gyro_zValue));
+                                       return;
+                               }
+                               
+                               gyro_zValue = Double.parseDouble(number);
+                               zData = (int)(Double.parseDouble(number) * 100 + gyro_forSliderVal);
+                               gyro_zSlider.setSelection(zData);
+                       }
+               });
+               
+               formUtil.createLabel(mainComposite, "[radians/second]");
+               
+               Composite subComposite = formUtil.createComposite(client, 2);
+               Button resetButton = formUtil.createButton(subComposite, "Reset", SWT.PUSH);
+               gd = new GridData(SWT.NONE, SWT.FILL, false, true);
+               gd.widthHint = 100;
+               resetButton.setLayoutData(gd);
+               
+               resetButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               reset();
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
+               
+               Button sendButton = formUtil.createButton(subComposite, "Send", SWT.PUSH);
+               gd = new GridData(SWT.NONE, SWT.FILL, false, true);
+               gd.widthHint = 100;
+               sendButton.setLayoutData(gd);
+               
+               sendButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               sendMessage();
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
+               
+               /////////////////// File Input ////////////////////////////////////
+                               
+               Composite client2 = formUtil.createSection(parent, "File input");
+               Composite fileComposite = formUtil.createComposite(client2, 4);
+               gd = new GridData(GridData.FILL, GridData.FILL, false, true);
+               gd.widthHint = 560;
+               fileComposite.setLayoutData(gd);
+               filenameText = formUtil.createText(fileComposite, "");
+               gd = new GridData(SWT.NONE, SWT.NONE, false, true);
+               gd.widthHint = 320;
+               filenameText.setLayoutData(gd);
+               filenameText.setEditable(false);
+               Button browserButton = formUtil.createButton(fileComposite, "Browse", SWT.PUSH);
+               gd = new GridData(SWT.NONE, SWT.NONE, false, true);
+               gd.widthHint = 100;
+               browserButton.setLayoutData(gd);
+               browserButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               String filename = "";
+                               FileDialog dialog = new FileDialog(new Shell());
+                               filename = dialog.open();
+                               
+                               if(filename == null)
+                                       return;
+                               
+                               filenameText.setText(filename);
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
+               
+               addButton = formUtil.createButton(fileComposite, "Add", SWT.PUSH);
+               gd = new GridData(SWT.NONE, SWT.NONE, false, true);
+               gd.widthHint = 100;
+               addButton.setLayoutData(gd);
+               addButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               if(model.size() == 5)
+                               {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "The maximum number of files is 5.");
+                                       return;
+                               }
+                               
+                               FileListVO fl = new FileListVO();
+                               fl.setNum(++fileCnt);
+                               fl.setFilePath(filenameText.getText());
+                               model.add(fl);
+                               viewer.refresh();
+                               
+                               startButton.setEnabled(true);
+                               deleteButton.setEnabled(true);
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
+               
+               Composite listComposite = formUtil.createComposite(client2, 1);
+               String[] columnNames = {
+                               "No.",
+                               "File path"     
+               };
+               
+               viewer = formUtil.createTableViewer(listComposite, columnNames);
+               gd = new GridData(SWT.NONE, SWT.NONE, false, true);
+               gd.widthHint = 540;
+               gd.heightHint = 76;
+               viewer.getControl().setLayoutData(gd);
+               
+               viewer.setContentProvider(new TableViewContentProvider());
+               viewer.setLabelProvider(new TableViewLabelProvider(viewer));
+               viewer.setInput(model);
+               
+               Composite fileComposite2 = formUtil.createComposite(client2, 8);
+               formUtil.createLabel(fileComposite2, "Repeat : ");
+               
+               Button leftButton = formUtil.createButton(fileComposite2, "<", SWT.PUSH);
+               leftButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               if(repeatCount != 1)
+                                       repeatCount -= 1;
+                               
+                               repeatText.setText(String.format("%d", repeatCount));
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub      
+                       }
+               });
+               
+               repeatText = formUtil.createText(fileComposite2, String.format("%d", repeatCount));
+               gd = new GridData(SWT.NONE, SWT.NONE, false, true);
+               gd.widthHint = 8;
+               repeatText.setLayoutData(gd);
+               repeatText.setEditable(false);
+               
+               Button rightButton = formUtil.createButton(fileComposite2, ">", SWT.PUSH);
+               rightButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               if(repeatCount != 9)
+                                       repeatCount += 1;
+                               
+                               repeatText.setText(String.format("%d", repeatCount));
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
+               
+               formUtil.createLabel(fileComposite2, " ");
+               
+               startButton = formUtil.createButton(fileComposite2, "Start", SWT.PUSH);
+               gd = new GridData(SWT.NONE, SWT.NONE, false, true);
+               gd.widthHint = 100;
+               startButton.setLayoutData(gd);
+               startButton.setEnabled(false);
+               startButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               // PUSH FILE TO EMULATOR
+                               Object[] obj = model.getDatas();
+                               String files = "";
+                               for(int i = 0; i < model.size(); i++)
+                               {
+                                       FileListVO fl = (FileListVO)obj[i];
+                                       File file = new File(fl.getFilePath());
+                                       if (file.exists()) {
+                                               try {
+                                                       final IDevice device = ConnectionPlugin.getDefault().getCurrentDevice();
+                                                       final SyncService sync = device.getSyncService();
+                                                       if (sync != null)
+                                                       {
+                                                               logFileName = file.getName();
+                                                               files += logFileName + "\n";
+                                                               sync.push(file.getPath(), device.getFileEntry( remoteFilePath ) );// Fixxed
+                                                       }
+                                               } catch (IOException e1) {
+                                                       e1.printStackTrace();
+                                               } catch (Exception e1) {
+                                                       // TODO Auto-generated catch block
+                                                       e1.printStackTrace();
+                                               }
+                                       }
+                               }
+                               
+                               startButton.setEnabled(false);
+                               stopButton.setEnabled(true);
+                               deleteButton.setEnabled(false);
+                               addButton.setEnabled(false);
+                               sendFileMessage(files);
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
+               
+               stopButton = formUtil.createButton(fileComposite2, "Stop", SWT.PUSH);
+               gd = new GridData(SWT.NONE, SWT.NONE, false, true);
+               gd.widthHint = 100;
+               stopButton.setLayoutData(gd);
+               stopButton.setEnabled(false);
+               stopButton.addSelectionListener(new SelectionListener () {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               sendFileStop();
+                               stopButton.setEnabled(false);
+                               startButton.setEnabled(true);
+                               deleteButton.setEnabled(true);
+                               addButton.setEnabled(true);
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
+               
+               deleteButton = formUtil.createButton(fileComposite2, "Delete", SWT.PUSH);
+               gd = new GridData(SWT.NONE, SWT.NONE, false, true);
+               gd.widthHint = 100;
+               deleteButton.setLayoutData(gd);
+               deleteButton.setEnabled(false);
+               deleteButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               IStructuredSelection selection = (IStructuredSelection)viewer.getSelection();
+                               Object [] objs = selection.toArray();
+                               for (int i = 0; i < objs.length; i++) 
+                               {
+                                       FileListVO fl = ((FileListVO)objs[i]);
+                                       model.remove(fl);
+                                       fileCnt--;
+                               }
+                               
+                               Object[] obj = model.getDatas();
+                               for (int i = 0; i < model.size(); i++)
+                               {
+                                       FileListVO fl = (FileListVO)obj[i];
+                                       fl.setNum(i+1);
+                               }
+                               
+                               viewer.refresh();
+                               
+                               if(fileCnt == 0)
+                               {
+                                       startButton.setEnabled(false);
+                                       deleteButton.setEnabled(false);
+                               }
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
+       }
+       
+       public void addViewer(TableViewer viewer){
+               viewerList.add(viewer);
+       }
+       
+       public void refresh(){
+               for(int i=1;i<viewerList.size();i++){
+                       viewerList.get(i).refresh();
+               }
+       }
+       
+       @Override
+       protected void createContents() {
+               createGyro();
+       }
+       
+       public static boolean isNumeric(String str) {   
+               return str.matches("-?\\d+(.\\d+)?"); 
+       } 
+
+       @Override
+       protected void registerReceivers() {
+               // TODO Auto-generated method stub
+
+       }
+       
+       private void setDefaultSlider(Slider slider, int max) {
+           slider.setMinimum(0);
+           slider.setMaximum(max);
+           slider.setIncrement(1);
+           slider.setThumb(1);
+       }
+       
+       public void sendMessage() {
+               gyro_xValue = Double.parseDouble(gyro_xText.getText());
+               gyro_yValue = Double.parseDouble(gyro_yText.getText());
+               gyro_zValue = Double.parseDouble(gyro_zText.getText());
+               TestSensorMessage msg = new TestSensorMessage(gyro_xValue * 1000, gyro_yValue * 1000, gyro_zValue * 1000);
+               
+               try {
+                       injectorSocket.sendSensor(SensorConstants.GYRO_ID + msg.getMessage());
+               } catch (IOException e1) {
+                       e1.printStackTrace();
+               } catch (Exception e1) {
+                       // TODO Auto-generated catch block
+                       e1.printStackTrace();
+               }
+       }
+       
+       public void sendFileMessage(String files) {
+               String msg = String.format("%d\n%d\n%s", repeatCount, fileCnt, files);
+               try {
+                       injectorSocket.sendSensor(SensorConstants.FILE_GYRO_ID + msg);
+               } catch (IOException e1) {
+                       e1.printStackTrace();
+               } catch (Exception e1) {
+                       // TODO Auto-generated catch block
+                       e1.printStackTrace();
+               }
+       }
+       
+       public void sendFileStop() {
+               String msg = String.format("0\n");
+               try {
+                       injectorSocket.sendSensor(SensorConstants.FILE_GYRO_ID + msg);
+               } catch (IOException e1) {
+                       e1.printStackTrace();
+               } catch (Exception e1) {
+                       // TODO Auto-generated catch block
+                       e1.printStackTrace();
+               }
+       }
+}
diff --git a/org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/accelerometer/page/ManualInputMagnetic.java b/org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/accelerometer/page/ManualInputMagnetic.java
new file mode 100644 (file)
index 0000000..e3ba6b4
--- /dev/null
@@ -0,0 +1,642 @@
+/*
+ * org.tizen.injector.sensor.accelerometer
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.sensor.accelerometer.page;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Slider;
+import org.eclipse.swt.widgets.Text;
+import org.tizen.common.connection.ConnectionPlugin;
+import org.tizen.injector.InjectorDialog;
+import org.tizen.injector.control.TableViewContentProvider;
+import org.tizen.injector.control.TableViewLabelProvider;
+import org.tizen.injector.model.DefaultTableModel;
+import org.tizen.injector.protocol.sensor.TestSensorMessage;
+import org.tizen.injector.provider.AbstractInjectorItem;
+import org.tizen.injector.provider.AbstractInjectorPage;
+import org.tizen.injector.sensor.accelerometer.FileListVO;
+import org.tizen.injector.sensor.accelerometer.SensorConstants;
+import org.tizen.sdblib.IDevice;
+import org.tizen.sdblib.service.SyncResult;
+import org.tizen.sdblib.service.SyncService;
+
+public class ManualInputMagnetic extends AbstractInjectorPage {
+       private String logFileName = null;
+       private String remoteFilePath = "/opt/sensor/geo/InputFiles/";
+       Slider magnetic_xSlider, magnetic_ySlider, magnetic_zSlider;
+       private Text magnetic_xText, magnetic_yText, magnetic_zText;
+       int magnetic_xValue, magnetic_yValue, magnetic_zValue;
+       int magnetic_forSliderVal = 2000;
+       
+       private Text filenameText, repeatText;  
+       private Button startButton, stopButton, deleteButton;
+       private Button addButton;
+       
+       private TableViewer viewer;
+       private DefaultTableModel model = new DefaultTableModel(new FileListVO());
+       private ArrayList<TableViewer> viewerList = new ArrayList<TableViewer>();
+       public int repeatCount = 1, fileCnt = 0;
+       
+       public ManualInputMagnetic(AbstractInjectorItem item, String name) {
+               super(item, name);
+
+       }
+       
+       private void reset() {
+               magnetic_xValue = 0;
+               magnetic_xSlider.setSelection(magnetic_forSliderVal);
+               magnetic_xText.setText(Integer.toString(magnetic_xValue));
+               
+               magnetic_yValue = 0;
+               magnetic_ySlider.setSelection(magnetic_forSliderVal);
+               magnetic_yText.setText(Integer.toString(magnetic_yValue));
+               
+               magnetic_zValue = 0;
+               magnetic_zSlider.setSelection(magnetic_forSliderVal);
+               magnetic_zText.setText(Integer.toString(magnetic_zValue));
+       }
+       
+       private void createMagnetic() {
+               Composite client = formUtil.createSection(parent, "Magnetic");
+               int maxSliderVal = 4001;
+               // X
+               Composite mainComposite = formUtil.createComposite(client, 4);
+               GridData gd = new GridData(SWT.NONE, SWT.FILL, false, true);
+               gd.widthHint = 560;
+               mainComposite.setLayoutData(gd);
+               
+               formUtil.createLabel(mainComposite, "X : ");
+               magnetic_xSlider = formUtil.createSlider(mainComposite);
+               gd = new GridData(SWT.NONE, SWT.CENTER, false, true);
+               gd.widthHint = 440;
+               magnetic_xSlider.setLayoutData(gd);
+           setDefaultSlider(magnetic_xSlider, maxSliderVal);
+           magnetic_xSlider.setSelection(magnetic_forSliderVal);
+           magnetic_xSlider.addSelectionListener(new SelectionListener() {
+
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               int xData;
+                               xData = magnetic_xSlider.getSelection() - magnetic_forSliderVal;
+                               magnetic_xValue = xData;
+                               magnetic_xText.setText(Integer.toString(magnetic_xValue));
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+           });
+                   
+           magnetic_xValue = magnetic_xSlider.getSelection() - magnetic_forSliderVal;
+               magnetic_xText = formUtil.createText(mainComposite, "" + magnetic_xValue);
+               gd = new GridData(SWT.NONE, SWT.FILL, false, true);
+               gd.widthHint = 40;
+               magnetic_xText.setLayoutData(gd);
+               magnetic_xText.setTextLimit(8);
+               magnetic_xText.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               int xData;
+                               String number = magnetic_xText.getText().trim();
+                               if(number==null||number.length()==0)
+                                       return;
+                               
+                               try {
+                                       if(!isNumeric(number) || Integer.parseInt(number) < -2000 || Integer.parseInt(number) > 2000)
+                                               throw null;
+                               } catch (NumberFormatException err) {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter an integer number of units.\nX value can be entered in the range of -2000 to 2000.");
+                                       magnetic_xText.setText(Integer.toString(magnetic_xValue));
+                                       return;
+                               } catch (Exception err) {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter an integer number of units.\nX value can be entered in the range of -2000 to 2000.");
+                                       magnetic_xText.setText(Integer.toString(magnetic_xValue));
+                                       return;
+                               }
+                               
+                               magnetic_xValue = Integer.parseInt(number);
+                               xData = magnetic_xValue + magnetic_forSliderVal;
+                               magnetic_xSlider.setSelection(xData);
+                       }
+               });
+               
+               formUtil.createLabel(mainComposite, "[μT]");
+               
+               // Y
+               formUtil.createLabel(mainComposite, "Y : ");
+               magnetic_ySlider = formUtil.createSlider(mainComposite);
+           setDefaultSlider(magnetic_ySlider, maxSliderVal);
+           gd = new GridData(SWT.NONE, SWT.CENTER, false, true);
+               gd.widthHint = 440;
+               magnetic_ySlider.setLayoutData(gd);
+           magnetic_ySlider.setSelection(magnetic_forSliderVal);
+           magnetic_ySlider.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               int yData;
+                               yData = magnetic_ySlider.getSelection() - magnetic_forSliderVal;
+                               magnetic_yValue = yData;
+                               magnetic_yText.setText(Integer.toString(magnetic_yValue));
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+           });
+                   
+               magnetic_yValue = magnetic_ySlider.getSelection() - magnetic_forSliderVal;
+               magnetic_yText = formUtil.createText(mainComposite, "" + magnetic_yValue);
+               gd = new GridData(SWT.NONE, SWT.FILL, false, true);
+               gd.widthHint = 40;
+               magnetic_yText.setLayoutData(gd);
+               magnetic_yText.setTextLimit(8);
+               magnetic_yText.addSelectionListener(new SelectionAdapter() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               int yData;
+                               String number = magnetic_yText.getText().trim();
+                               if(number==null||number.length()==0)
+                                       return;
+                               
+                               try {
+                                       if(!isNumeric(number) || Integer.parseInt(number) < -2000 || Integer.parseInt(number) > 2000)
+                                               throw null;
+                               } catch (NumberFormatException err) {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter an integer number of units.\nX value can be entered in the range of -2000 to 2000.");
+                                       magnetic_xText.setText(Integer.toString(magnetic_xValue));
+                                       return;
+                               } catch (Exception err) {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter an integer number of units.\nY value can be entered in the range of -2000 to 2000.");
+                                       magnetic_yText.setText(Integer.toString(magnetic_yValue));
+                                       return;
+                               }
+                               
+                               magnetic_yValue = Integer.parseInt(number);
+                               yData = magnetic_yValue + magnetic_forSliderVal;
+                               magnetic_ySlider.setSelection(yData);
+                       }
+               });
+
+               formUtil.createLabel(mainComposite, "[μT]");
+               
+               // Z            
+               formUtil.createLabel(mainComposite, "Z : ");
+               magnetic_zSlider = formUtil.createSlider(mainComposite);
+           setDefaultSlider(magnetic_zSlider, maxSliderVal);
+           gd = new GridData(SWT.NONE, SWT.CENTER, false, true);
+               gd.widthHint = 440;
+               magnetic_zSlider.setLayoutData(gd);
+           magnetic_zSlider.setSelection(magnetic_forSliderVal);
+           magnetic_zSlider.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               int zData;
+                               zData = magnetic_zSlider.getSelection() - magnetic_forSliderVal;
+                               magnetic_zValue = zData;
+                               magnetic_zText.setText(Integer.toString(magnetic_zValue));
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+           });
+                 
+           magnetic_zValue = magnetic_zSlider.getSelection() - magnetic_forSliderVal;
+               magnetic_zText = formUtil.createText(mainComposite, "" + magnetic_zValue);
+               gd = new GridData(SWT.NONE, SWT.FILL, false, true);
+               gd.widthHint = 40;
+               magnetic_zText.setLayoutData(gd);
+               magnetic_zText.setTextLimit(8);
+               magnetic_zText.addSelectionListener(new SelectionAdapter() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               int zData;
+                               String number = magnetic_zText.getText().trim();
+                               if(number==null||number.length()==0)
+                                       return;
+                               
+                               try {
+                                       if(!isNumeric(number) || Integer.parseInt(number) < -2000 || Integer.parseInt(number) > 2000)
+                                               throw null;
+                               } catch (NumberFormatException err) {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter an integer number of units.\nX value can be entered in the range of -2000 to 2000.");
+                                       magnetic_xText.setText(Integer.toString(magnetic_xValue));
+                                       return;
+                               } catch (Exception err) {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter an integer number of units.\nZ value can be entered in the range of -2000 to 2000.");
+                                       magnetic_zText.setText(Integer.toString(magnetic_zValue));
+                                       return;
+                               }
+                               
+                               magnetic_zValue = Integer.parseInt(number);
+                               zData = magnetic_zValue + magnetic_forSliderVal;
+                               magnetic_zSlider.setSelection(zData);
+                       }
+               });
+
+               formUtil.createLabel(mainComposite, "[μT]");
+               
+               Composite subComposite = formUtil.createComposite(client, 2);
+               Button resetButton = formUtil.createButton(subComposite, "Reset", SWT.PUSH);
+               gd = new GridData(SWT.NONE, SWT.FILL, false, true);
+               gd.widthHint = 100;
+               resetButton.setLayoutData(gd);
+               
+               resetButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               reset();
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
+               
+               Button sendButton = formUtil.createButton(subComposite, "Send", SWT.PUSH);
+               gd = new GridData(SWT.NONE, SWT.FILL, false, true);
+               gd.widthHint = 100;
+               sendButton.setLayoutData(gd);
+               
+               sendButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               sendMessage();
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
+               
+               /////////////////// File Input ////////////////////////////////////
+                               
+               Composite client2 = formUtil.createSection(parent, "File input");
+               Composite fileComposite = formUtil.createComposite(client2, 4);
+               gd = new GridData(GridData.FILL, GridData.FILL, false, true);
+               gd.widthHint = 560;
+               fileComposite.setLayoutData(gd);
+               filenameText = formUtil.createText(fileComposite, "");
+               gd = new GridData(SWT.NONE, SWT.NONE, false, true);
+               gd.widthHint = 320;
+               filenameText.setLayoutData(gd);
+               filenameText.setEditable(false);
+               Button browserButton = formUtil.createButton(fileComposite, "Browse", SWT.PUSH);
+               gd = new GridData(SWT.NONE, SWT.NONE, false, true);
+               gd.widthHint = 100;
+               browserButton.setLayoutData(gd);
+               browserButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               String filename = "";
+                               FileDialog dialog = new FileDialog(new Shell());
+                               filename = dialog.open();
+                               
+                               if(filename == null)
+                                       return;
+                               
+                               filenameText.setText(filename);
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
+               
+               addButton = formUtil.createButton(fileComposite, "Add", SWT.PUSH);
+               gd = new GridData(SWT.NONE, SWT.NONE, false, true);
+               gd.widthHint = 100;
+               addButton.setLayoutData(gd);
+               addButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               if(model.size() == 5)
+                               {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "The maximum number of files is 5.");
+                                       return;
+                               }
+                               
+                               FileListVO fl = new FileListVO();
+                               fl.setNum(++fileCnt);
+                               fl.setFilePath(filenameText.getText());
+                               model.add(fl);
+                               viewer.refresh();
+                               
+                               startButton.setEnabled(true);
+                               deleteButton.setEnabled(true);
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
+               
+               Composite listComposite = formUtil.createComposite(client2, 1);
+               String[] columnNames = {
+                               "No.",
+                               "File path"     
+               };
+               
+               viewer = formUtil.createTableViewer(listComposite, columnNames);
+               gd = new GridData(SWT.NONE, SWT.NONE, false, true);
+               gd.widthHint = 540;
+               gd.heightHint = 76;
+               viewer.getControl().setLayoutData(gd);
+               
+               viewer.setContentProvider(new TableViewContentProvider());
+               viewer.setLabelProvider(new TableViewLabelProvider(viewer));
+               viewer.setInput(model);
+               
+               Composite fileComposite2 = formUtil.createComposite(client2, 8);
+               formUtil.createLabel(fileComposite2, "Repeat : ");
+               
+               Button leftButton = formUtil.createButton(fileComposite2, "<", SWT.PUSH);
+               leftButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               if(repeatCount != 1)
+                                       repeatCount -= 1;
+                               
+                               repeatText.setText(String.format("%d", repeatCount));
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub      
+                       }
+               });
+               
+               repeatText = formUtil.createText(fileComposite2, String.format("%d", repeatCount));
+               gd = new GridData(SWT.NONE, SWT.NONE, false, true);
+               gd.widthHint = 8;
+               repeatText.setLayoutData(gd);
+               repeatText.setEditable(false);
+               
+               Button rightButton = formUtil.createButton(fileComposite2, ">", SWT.PUSH);
+               rightButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               if(repeatCount != 9)
+                                       repeatCount += 1;
+                               
+                               repeatText.setText(String.format("%d", repeatCount));
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
+               
+               formUtil.createLabel(fileComposite2, " ");
+               
+               startButton = formUtil.createButton(fileComposite2, "Start", SWT.PUSH);
+               gd = new GridData(SWT.NONE, SWT.NONE, false, true);
+               gd.widthHint = 100;
+               startButton.setLayoutData(gd);
+               startButton.setEnabled(false);
+               startButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               // PUSH FILE TO EMULATOR
+                               Object[] obj = model.getDatas();
+                               String files = "";
+                               for(int i = 0; i < model.size(); i++)
+                               {
+                                       FileListVO fl = (FileListVO)obj[i];
+                                       File file = new File(fl.getFilePath());
+                                       if (file.exists()) {
+                                               @SuppressWarnings("unused")
+                                               SyncResult result;
+                                               try {
+                                                       IDevice device = ConnectionPlugin.getDefault().getCurrentDevice();
+                                                       SyncService sync = device.getSyncService();
+                                                       if (sync != null)
+                                                       {
+                                                               logFileName = file.getName();
+                                                               files += logFileName + "\n";
+                                                               result = sync.push(file.getPath(), device.getFileEntry( remoteFilePath ) );// Fixxed
+                                                       }
+                                               } catch (IOException e1) {
+                                                       e1.printStackTrace();
+                                               } catch (Exception e1) {
+                                                       // TODO Auto-generated catch block
+                                                       e1.printStackTrace();
+                                               }
+                                       }
+                               }
+                               
+                               startButton.setEnabled(false);
+                               stopButton.setEnabled(true);
+                               deleteButton.setEnabled(false);
+                               addButton.setEnabled(false);
+                               sendFileMessage(files);
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
+               
+               stopButton = formUtil.createButton(fileComposite2, "Stop", SWT.PUSH);
+               gd = new GridData(SWT.NONE, SWT.NONE, false, true);
+               gd.widthHint = 100;
+               stopButton.setLayoutData(gd);
+               stopButton.setEnabled(false);
+               stopButton.addSelectionListener(new SelectionListener () {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               sendFileStop();
+                               stopButton.setEnabled(false);
+                               startButton.setEnabled(true);
+                               deleteButton.setEnabled(true);
+                               addButton.setEnabled(true);
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
+               
+               deleteButton = formUtil.createButton(fileComposite2, "Delete", SWT.PUSH);
+               gd = new GridData(SWT.NONE, SWT.NONE, false, true);
+               gd.widthHint = 100;
+               deleteButton.setLayoutData(gd);
+               deleteButton.setEnabled(false);
+               deleteButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               IStructuredSelection selection = (IStructuredSelection)viewer.getSelection();
+                               Object [] objs = selection.toArray();
+                               for (int i = 0; i < objs.length; i++) 
+                               {
+                                       FileListVO fl = ((FileListVO)objs[i]);
+                                       model.remove(fl);
+                                       fileCnt--;
+                               }
+                               
+                               Object[] obj = model.getDatas();
+                               for (int i = 0; i < model.size(); i++)
+                               {
+                                       FileListVO fl = (FileListVO)obj[i];
+                                       fl.setNum(i+1);
+                               }
+                               
+                               viewer.refresh();
+                               
+                               if(fileCnt == 0)
+                               {
+                                       startButton.setEnabled(false);
+                                       deleteButton.setEnabled(false);
+                               }
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
+       }
+       
+       public void addViewer(TableViewer viewer){
+               viewerList.add(viewer);
+       }
+       
+       public void refresh(){
+               for(int i=1;i<viewerList.size();i++){
+                       viewerList.get(i).refresh();
+               }
+       }
+       
+       @Override
+       protected void createContents() {
+               createMagnetic();
+       }
+       
+       public static boolean isNumeric(String str) {   
+               return str.matches("-?\\d+(\\d+)?"); 
+       }
+
+       @Override
+       protected void registerReceivers() {
+               // TODO Auto-generated method stub
+
+       }
+       
+       private void setDefaultSlider(Slider slider, int max) {
+           slider.setMinimum(0);
+           slider.setMaximum(max);
+           slider.setIncrement(1);
+           slider.setThumb(1);
+       }
+
+       public void sendMessage() {
+               magnetic_xValue = Integer.parseInt(magnetic_xText.getText());
+               magnetic_yValue = Integer.parseInt(magnetic_yText.getText());
+               magnetic_zValue = Integer.parseInt(magnetic_zText.getText());
+               TestSensorMessage msg = new TestSensorMessage(magnetic_xValue, magnetic_yValue, magnetic_zValue);
+               
+               try {
+                       injectorSocket.sendSensor(SensorConstants.MAGNETIC_ID + msg.getMessage());
+               } catch (IOException e1) {
+                       e1.printStackTrace();
+               } catch (Exception e1) {
+                       // TODO Auto-generated catch block
+                       e1.printStackTrace();
+               }
+       }
+       
+       public void sendFileMessage(String files) {
+               String msg = String.format("%d\n%d\n%s", repeatCount, fileCnt, files);
+               try {
+                       injectorSocket.sendSensor(SensorConstants.FILE_MAGNETIC_ID + msg);
+               } catch (IOException e1) {
+                       e1.printStackTrace();
+               } catch (Exception e1) {
+                       // TODO Auto-generated catch block
+                       e1.printStackTrace();
+               }
+       }
+       
+       public void sendFileStop() {
+               String msg = String.format("0\n");
+               try {
+                       injectorSocket.sendSensor(SensorConstants.FILE_MAGNETIC_ID + msg);
+               } catch (IOException e1) {
+                       e1.printStackTrace();
+               } catch (Exception e1) {
+                       // TODO Auto-generated catch block
+                       e1.printStackTrace();
+               }
+       }
+}
diff --git a/org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/accelerometer/page/ManualInputTilt.java b/org.tizen.injector.sensor.accelerometer/src/org/tizen/injector/sensor/accelerometer/page/ManualInputTilt.java
new file mode 100644 (file)
index 0000000..c33975d
--- /dev/null
@@ -0,0 +1,359 @@
+/*
+ * org.tizen.injector.sensor.accelerometer
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.sensor.accelerometer.page;
+
+import java.io.IOException;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Slider;
+import org.eclipse.swt.widgets.Text;
+
+import org.tizen.injector.InjectorDialog;
+import org.tizen.injector.protocol.sensor.TestSensorMessage;
+import org.tizen.injector.provider.AbstractInjectorItem;
+import org.tizen.injector.provider.AbstractInjectorPage;
+import org.tizen.injector.sensor.accelerometer.SensorConstants;
+
+public class ManualInputTilt extends AbstractInjectorPage {
+       Slider tilt_xSlider, tilt_ySlider, tilt_zSlider;
+       private Text tilt_xText, tilt_yText, tilt_zText;
+       int tilt_xValue, tilt_yValue, tilt_zValue;
+       int tilt_forSliderVal = 180;
+       
+       public ManualInputTilt(AbstractInjectorItem item, String name) {
+               super(item, name);
+
+       }
+       
+       private void reset() {
+               tilt_xValue = tilt_forSliderVal;
+               tilt_xSlider.setSelection(tilt_forSliderVal);
+               tilt_xText.setText(Integer.toString(tilt_forSliderVal));
+               
+               tilt_yValue = 0;
+               tilt_ySlider.setSelection(tilt_forSliderVal);
+               tilt_yText.setText(Integer.toString(tilt_yValue));
+               
+               tilt_zValue = 0;
+               tilt_zSlider.setSelection(tilt_forSliderVal);
+               tilt_zText.setText(Integer.toString(tilt_zValue));
+       }
+       
+       private void createTilt() {
+               Composite client = formUtil.createSection(parent, "Tilt");
+               int maxSliderVal = 361;
+               
+               // Azimuth
+               Composite mainComposite = formUtil.createComposite(client, 4);
+               GridData gd = new GridData(SWT.NONE, SWT.FILL, false, true);
+               gd.widthHint = 560;
+               mainComposite.setLayoutData(gd);
+               
+               formUtil.createLabel(mainComposite, "Azimuth : ");
+               tilt_xSlider = formUtil.createSlider(mainComposite);
+               gd = new GridData(SWT.NONE, SWT.CENTER, false, true);
+               gd.widthHint = 390;
+               tilt_xSlider.setLayoutData(gd);
+           setDefaultSlider(tilt_xSlider, maxSliderVal);
+           tilt_xSlider.setSelection(tilt_forSliderVal);
+           tilt_xSlider.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               int xData;
+                               xData = tilt_xSlider.getSelection();
+                               tilt_xValue = xData;
+                               tilt_xText.setText(Integer.toString(xData));
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+           });
+                   
+               tilt_xValue = tilt_xSlider.getSelection();
+               tilt_xText = formUtil.createText(mainComposite, "" + tilt_xValue);
+               gd = new GridData(SWT.NONE, SWT.FILL, false, true);
+               gd.widthHint = 30;
+               tilt_xText.setLayoutData(gd);
+               tilt_xText.setTextLimit(3);
+               tilt_xText.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               int xData;
+                               String number = tilt_xText.getText().trim();
+                               if(number==null||number.length()==0)
+                                       return;
+                               
+                               try {
+                                       if(!isNumeric(number) || Integer.parseInt(number) < 0 || Integer.parseInt(number) > 360)
+                                               throw null;
+                               } catch (NumberFormatException err) {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter an positive integer number of units.\nAzimuth value can be entered in the range of 0 to 360.");
+                                       tilt_xText.setText(Integer.toString(tilt_xValue));
+                                       return;
+                               } catch (Exception err) {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter an positive integer number of units.\nAzimuth value can be entered in the range of 0 to 360.");
+                                       tilt_xText.setText(Integer.toString(tilt_xValue));
+                                       return;
+                               }
+
+                               xData = Integer.parseInt(number);
+                               tilt_xValue = xData;
+                               tilt_xSlider.setSelection(xData);
+                       }
+               });
+               formUtil.createLabel(mainComposite, "[degrees]");
+               
+               // Pitch
+               formUtil.createLabel(mainComposite, "Pitch :");
+               tilt_ySlider = formUtil.createSlider(mainComposite);
+           setDefaultSlider(tilt_ySlider, maxSliderVal);
+           gd = new GridData(SWT.NONE, SWT.CENTER, false, true);
+               gd.widthHint = 390;
+               tilt_ySlider.setLayoutData(gd);
+           tilt_ySlider.setSelection(tilt_forSliderVal);
+           tilt_ySlider.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               int yData;
+                               yData = tilt_ySlider.getSelection() - tilt_forSliderVal;
+                               tilt_yValue = yData;
+                               tilt_yText.setText(Integer.toString(yData));
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+           });
+                   
+               tilt_yValue = tilt_ySlider.getSelection() - tilt_forSliderVal;
+               tilt_yText = formUtil.createText(mainComposite, "" + tilt_yValue);
+               gd = new GridData(SWT.NONE, SWT.FILL, false, true);
+               gd.widthHint = 30;
+               tilt_yText.setLayoutData(gd);
+               tilt_yText.addSelectionListener(new SelectionAdapter() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               int yData;
+                               String number = tilt_yText.getText().trim();
+                               if(number==null||number.length()==0)
+                                       return;
+                               
+                               try {
+                                       if(!isNumeric(number) || Integer.parseInt(number) < -180 || Integer.parseInt(number) > 180)
+                                               throw null;
+                               } catch (NumberFormatException err) {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter an positive integer number of units.\nAzimuth value can be entered in the range of 0 to 360.");
+                                       tilt_xText.setText(Integer.toString(tilt_xValue));
+                                       return;
+                               } catch (Exception err) {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter an integer number of units.\nPitch value can be entered in the range of -180 to 180.");
+                                       tilt_yText.setText(Integer.toString(tilt_yValue));
+                                       return;
+                               }
+                               
+                               yData = Integer.parseInt(number) + tilt_forSliderVal;
+                               tilt_yValue = yData;
+                               tilt_ySlider.setSelection(yData);
+                       }
+               });
+               tilt_yText.setTextLimit(4);
+               formUtil.createLabel(mainComposite, "[degrees]");
+               
+               // Roll
+               formUtil.createLabel(mainComposite, "Roll :");
+               tilt_zSlider = formUtil.createSlider(mainComposite);
+           setDefaultSlider(tilt_zSlider, maxSliderVal);
+           gd = new GridData(SWT.NONE, SWT.CENTER, false, true);
+               gd.widthHint = 390;
+               tilt_zSlider.setLayoutData(gd);
+           tilt_zSlider.setSelection(tilt_forSliderVal);
+           tilt_zSlider.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               int zData;
+                               zData = tilt_zSlider.getSelection() - tilt_forSliderVal;
+                               tilt_zValue = zData;
+                               tilt_zText.setText(Integer.toString(zData));
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+           });
+                 
+               tilt_zValue = tilt_zSlider.getSelection() - tilt_forSliderVal;
+               tilt_zText = formUtil.createText(mainComposite, "" + tilt_zValue);
+               gd = new GridData(SWT.NONE, SWT.FILL, false, true);
+               gd.widthHint = 30;
+               tilt_zText.setLayoutData(gd);
+               tilt_zText.addSelectionListener(new SelectionAdapter() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               int zData;
+                               String number = tilt_zText.getText().trim();
+                               if(number==null||number.length()==0)
+                                       return;
+                               
+                               try {
+                                       if(!isNumeric(number) || Integer.parseInt(number) < -180 || Integer.parseInt(number) > 180)
+                                               throw null;
+                               } catch (NumberFormatException err) {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter an positive integer number of units.\nAzimuth value can be entered in the range of 0 to 360.");
+                                       tilt_xText.setText(Integer.toString(tilt_xValue));
+                                       return;
+                               } catch (Exception err) {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter an integer number of units.\nRoll value can be entered in the range of -180 to 180.");
+                                       tilt_zText.setText(Integer.toString(tilt_zValue));
+                                       return;
+                               }
+                               
+                               zData = Integer.parseInt(number) + tilt_forSliderVal;
+                               tilt_zValue = zData;
+                               tilt_zSlider.setSelection(zData);
+                       }
+               });
+               tilt_zText.setTextLimit(4);
+               formUtil.createLabel(mainComposite, "[degrees]");
+               
+               Composite subComposite = formUtil.createComposite(client, 2);
+               Button resetButton = formUtil.createButton(subComposite, "Reset", SWT.PUSH);
+               gd = new GridData(SWT.NONE, SWT.FILL, false, true);
+               gd.widthHint = 100;
+               resetButton.setLayoutData(gd);
+               
+               resetButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               reset();
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
+               
+               Button sendButton = formUtil.createButton(subComposite, "Send", SWT.PUSH);
+               gd = new GridData(SWT.NONE, SWT.FILL, false, true);
+               gd.widthHint = 100;
+               sendButton.setLayoutData(gd);
+               
+               sendButton.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               sendMessage();
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+               });
+       }
+       
+       @Override
+       protected void createContents() {
+               createTilt();
+       }
+       
+       public static boolean isNumeric(String str) {   
+               return str.matches("-?\\d+(\\d+)?"); 
+       } 
+
+       @Override
+       protected void registerReceivers() {
+               // TODO Auto-generated method stub
+
+       }
+       
+       private void setDefaultSlider(Slider slider, int max) {
+           slider.setMinimum(0);
+           slider.setMaximum(max);
+           slider.setIncrement(1);
+           slider.setThumb(1);
+       }
+       
+       public void sendMessage() {
+               tilt_xValue = Integer.parseInt(tilt_xText.getText());
+               tilt_yValue = Integer.parseInt(tilt_yText.getText());
+               tilt_zValue = Integer.parseInt(tilt_zText.getText());
+               TestSensorMessage msg = new TestSensorMessage(tilt_xValue, tilt_yValue, tilt_zValue);
+               
+               try {
+                       injectorSocket.sendSensor(SensorConstants.TILT_ID + msg.getMessage());
+               } catch (IOException e1) {
+                       e1.printStackTrace();
+               } catch (Exception e1) {
+                       // TODO Auto-generated catch block
+                       e1.printStackTrace();
+               }
+               
+               TestSensorMessage msg2 = new TestSensorMessage((tilt_yValue/ 26.2) * 1.425, (tilt_zValue / 26.2) * 1.425, ((tilt_xValue - 180)/ 26.0) * 1.425);
+               try {
+                       injectorSocket.sendSensor(SensorConstants.ACCEL_ID + msg2.getMessage());
+               } catch (IOException e1) {
+                       e1.printStackTrace();
+               } catch (Exception e1) {
+                       // TODO Auto-generated catch block
+                       e1.printStackTrace();
+               }
+       }
+}
@@ -1,4 +1,4 @@
-package org.tizen.sensor.accelerometer.page;
+package org.tizen.injector.sensor.accelerometer.page;
 
 /* 
  * Copyright (C) 2008 OpenIntents.org
@@ -37,11 +37,12 @@ import javax.swing.Timer;
 
 import org.tizen.common.connection.ConnectionPlugin;
 import org.tizen.common.connection.ConnectionPlugin.ISelectionListener;
+import org.tizen.injector.sensor.accelerometer.SensorConstants;
+import org.tizen.injector.sensor.accelerometer.page.Accelerometer.Mode;
+import org.tizen.injector.sensor.magnetic.Magnetic;
 import org.tizen.injector.view.InjectorView;
-import org.tizen.sdblib.FileListingService.FileEntry;
 import org.tizen.sdblib.IDevice;
-import org.tizen.sensor.accelerometer.page.Accelerometer.Mode;
-import org.tizen.sensor.magnetic.Magnetic;
+import org.tizen.sdblib.service.FileEntry;
 
 /**
  * Displays a mobile phone in a panel and calculates sensor physics.
@@ -234,11 +235,10 @@ public class MobilePanel extends JPanel implements ISelectionListener {
        double gyroYaw;
        double gyroPitch;
        double gyroRoll;
-       
-       final String accelerometerSensorNumber = "1\n";
-       final String gyroSensorNumber = "4\n";
+
        public boolean phone_pos_conv = false;
        public IDevice currentDevice;
+       public boolean isWithAxis = false;
        
        /*
         * http://code.google.com/android/reference/android/hardware/Sensors.html
@@ -250,14 +250,19 @@ public class MobilePanel extends JPanel implements ISelectionListener {
         * surface. 
         */
        // Mobile size
-       final double sx = 15; // size x
-       final double sy = 40; // size y
-       final double sz = 5; // size z
+       final double sx = 15 * 1.4; // size x
+       final double sy = 40 * 1.4; // size y
+       final double sz = 5 * 1.4; // size z
        
        // Display size
-       final double dx = 12; // size x
-       final double dy1 = 33; // size y
-       final double dy2 = -15;
+       final double dx = 12 * 1.4; // size x
+       final double dy1 = 33 * 1.4; // size y
+       final double dy2 = -15 * 1.4;
+       
+       // for axis display
+       final double xAxisLen = -35;
+       final double yAxisLen = -75;
+       final double zAxisLen = -25;
        
        /** Contains the grid model of the phone. */
        double[][] phone = {
@@ -281,6 +286,12 @@ public class MobilePanel extends JPanel implements ISelectionListener {
                        {-dx, dy1, sz}, {-dx, dy2, sz},
                        {-dx, dy2, sz}, { dx, dy2, sz},
                        { dx, dy2, sz}, { dx, dy1, sz},
+                       // x axis
+                       { xAxisLen, 0, 0 }, { 0, 0, 0 },
+                       // y axis
+                       { 0, yAxisLen, 0 }, { 0, 0, 0 },
+                       // z axis
+                       { 0, 0, zAxisLen }, { 0, 0, 0 },
                };
        private Timer timer;
        private Timer geomagneticTimer;
@@ -288,6 +299,7 @@ public class MobilePanel extends JPanel implements ISelectionListener {
        private Timer orientationTimer;
        private boolean connected = false;
        
+       @SuppressWarnings("static-access")
        public void init_values() {
        mPage.pitchSlider.setSelection(90);
                mPage.yawSlider.setSelection(180);
@@ -321,19 +333,20 @@ public class MobilePanel extends JPanel implements ISelectionListener {
                mPage.button02.setSelection(false);
                mPage.button03.setSelection(false);
                mPage.mode = Mode.YAW_PITCH;
+               mPage.withAxisCheck.setSelection(false);
                
-               mPage.checkboxAccelerometer.setSelection(true);
-               mPage.panel.accelerometerTimer(mPage.checkboxAccelerometer.getSelection());
+               mPage.checkboxAcceleration.setSelection(true);
+               mPage.panel.accelerometerTimer(mPage.checkboxAcceleration.getSelection());
                
-               mPage.checkboxGeoMagnetic.setSelection(true);
-               mPage.panel.geomagneticTimer(mPage.checkboxGeoMagnetic.getSelection());
+               mPage.checkboxMagnetic.setSelection(true);
+               mPage.panel.geomagneticTimer(mPage.checkboxMagnetic.getSelection());
                
                mPage.checkboxGyro.setSelection(true);
                mPage.panel.gyroTimer(mPage.checkboxGyro.getSelection());
                
-               mPage.checkboxOrientation.setSelection(true);
-               mPage.panel.orientationTimer(mPage.checkboxOrientation.getSelection());
-               mPage.orientation_active = true;
+               mPage.checkboxTilt.setSelection(true);
+               mPage.panel.orientationTimer(mPage.checkboxTilt.getSelection());
+               mPage.tilt_active = true;
                
                Magnetic magnetic = Magnetic.getInstance();
                magnetic.setAzimuth(0);
@@ -390,7 +403,7 @@ public class MobilePanel extends JPanel implements ISelectionListener {
                
                dt = 0.1;
                meterperpixel = 1/3000.; // meter per pixel
-               g = 9.80665; // meter per second^2
+               g = -9.80665; // meter per second^2
                ginverse = 1 / g;
                
                user_settings_duration = 500;  // Update every half second. This should be enough.
@@ -429,11 +442,11 @@ public class MobilePanel extends JPanel implements ISelectionListener {
                                
                                // Control pitch
                                int newpitch = mousedownpitch - (e.getY() - mousedowny);
-                               while (newpitch > 180) {
+                               while (newpitch > 270) {
                                        newpitch -= 360;
                                        gyroPitchCount++;
                                }
-                               while (newpitch < -180) {
+                               while (newpitch < -90) {
                                        newpitch += 360;
                                        gyroPitchCount--;
                                }
@@ -454,11 +467,11 @@ public class MobilePanel extends JPanel implements ISelectionListener {
                                
                                // Control pitch
                                int newpitch = mousedownpitch - (e.getY() - mousedowny);
-                               while (newpitch > 180) {
+                               while (newpitch > 270) {
                                        newpitch -= 360;
                                        gyroPitchCount++;
                                }
-                               while (newpitch < -180) {
+                               while (newpitch < -90) {
                                        newpitch += 360;
                                        gyroPitchCount--;
                                }
@@ -489,7 +502,7 @@ public class MobilePanel extends JPanel implements ISelectionListener {
                 updateSensorReadoutValues();
                 updateUserSettings();
                 
-                mPage.sendMessage(accelerometerSensorNumber, read_accelx, read_accely, read_accelz);
+                mPage.sendMessage(SensorConstants.ACCEL_ID, read_accelx, read_accely, read_accelz);
                 
             }
         });
@@ -500,16 +513,21 @@ public class MobilePanel extends JPanel implements ISelectionListener {
                                magnetic.updateSensorPhysics(rollDegree, pitchDegree, yawDegree);
                                magnetic.updateSensorReadoutValues();
                                magnetic.updateUserSettings();
-                               if(Accelerometer.orientation_active)
-                                       magnetic.setOrient(read_accelx, read_accely, read_accelz);
+                               if(Accelerometer.tilt_active)
+                                       magnetic.setTilt(read_accelx, read_accely, read_accelz);
                                
-                               mPage.sendMessage(Magnetic.sensorNumber, magnetic.getAzimuth(), magnetic.getPitch(), magnetic.getRoll() , 4, magnetic.getReadCompassX(), magnetic.getReadCompassY(), magnetic.getReadCompassZ());
+                               mPage.sendMessage(SensorConstants.GEO_ID, magnetic.getAzimuth(), magnetic.getPitch(), magnetic.getRoll() , 3, magnetic.getReadCompassX(), magnetic.getReadCompassY(), magnetic.getReadCompassZ());
                        }
         });
         gyroTimer = new Timer(delay, new ActionListener(){
                public void actionPerformed(ActionEvent arg0) {
+                       double gPitch, gRoll, gYaw;
+                       gPitch = gyroPitch/200;
+                       gRoll = gyroRoll/200;
+                       gYaw = gyroYaw/200;
+  
                        updateSensorGyro();
-                       mPage.sendMessage(gyroSensorNumber, gyroPitch, gyroRoll, gyroYaw);
+                       mPage.sendMessage(SensorConstants.GYRO_ID, gPitch, gRoll, gYaw);
                        }
         });
 
@@ -539,12 +557,28 @@ private void updateSensorGyro(){
                old_gyroRoll = rollDegree;
                old_gyroPitch = pitchDegree;
                old_gyroYaw = yawDegree;
-               while( gyroRoll > 2000) gyroRoll-=360;
-               while( gyroRoll < -2000) gyroRoll+=360;
-               while( gyroPitch > 2000) gyroPitch-=360;
-               while( gyroPitch < -2000) gyroPitch+=360;
-               while( gyroYaw > 2000) gyroYaw-=360;
-               while( gyroYaw < -2000) gyroYaw+=360;
+               
+               if(gyroRoll > 573)
+                       gyroRoll = 573;
+               else if(gyroRoll < -573)
+                       gyroRoll = -573;
+               
+               if(gyroPitch > 573)
+                       gyroPitch = 573;
+               else if(gyroPitch < -573)
+                       gyroPitch = -573;
+               
+               if(gyroYaw > 573)
+                       gyroYaw = 573;
+               else if(gyroYaw < -573)
+                       gyroYaw = -573;
+               
+//             while( gyroRoll > 2000) gyroRoll-=360;
+//             while( gyroRoll < -2000) gyroRoll+=360;
+//             while( gyroPitch > 2000) gyroPitch-=360;
+//             while( gyroPitch < -2000) gyroPitch+=360;
+//             while( gyroYaw > 2000) gyroYaw-=360;
+//             while( gyroYaw < -2000) gyroYaw+=360;
        }
        
        /**
@@ -560,7 +594,7 @@ private void updateSensorGyro(){
                Vector vec;
 
                dt = 0.001 * 10;
-               g = 9.80665;
+               g = -9.80665;
                if (g != 0) {
                        ginverse = 1 / g;
                }
@@ -678,6 +712,20 @@ private void updateSensorGyro(){
                                read_accelz = accelz;
                        }
                        
+                       if(read_accelx / g > 2)
+                               read_accelx = 2 * g;
+                       else if(read_accelx / g < -2)
+                               read_accelx = -2 * g;
+                       
+                       if(read_accely / g > 2)
+                               read_accely = 2 * g;
+                       else if(read_accely / g < -2)
+                               read_accely = -2 * g;
+                       
+                       if(read_accelz / g > 2)
+                               read_accelz = 2 * g;
+                       else if(read_accelz / g < -2)
+                               read_accelz = -2 * g;
                }
 
                if (currentTime >= orientation_next_update) {
@@ -797,58 +845,69 @@ private void updateSensorGyro(){
         double draw_roll = old_gyro_rollDegree - rollDegree;
         double draw_pitch = old_gyro_pitchDegree-pitchDegree;
         double draw_yaw = old_gyro_yawDegree-yawDegree;
+        int vector_len = phone.length;
+        if(!isWithAxis)
+               vector_len = 32;
         
-        for (int i=0; i<phone.length; i+=2) {
-               if (i==0) g2.setColor(Color.RED);
-               if (i==24) g2.setColor(Color.BLUE);
-               
-               Vector v1 = new Vector(phone[i]);
-               Vector v2 = new Vector(phone[i+1]);
-               if( i == 0 ) {
-                       v1.setAxisX(gyro_axisX);
-               v1.setAxisY(gyro_axisY);
-               v1.setAxisZ(gyro_axisZ);
-                       v1.rollpitchyaw(draw_roll, draw_pitch, draw_yaw);
-               }
-
-               v1.setPosition();
-               v2.setPosition();
-               
-               if (phone_pos_conv == true) {
-                       if( i == 30){
-                               phone_pos_conv = false;
-                               
-                               gyro_axisX = Vector.getAxisX().clone();
-                               gyro_axisY = Vector.getAxisY().clone();
-                               gyro_axisZ = Vector.getAxisZ().clone();
-                               
-                               old_gyro_rollDegree = rollDegree;
-                               old_gyro_pitchDegree = pitchDegree;
-                               old_gyro_yawDegree = yawDegree;
-                       }
-               }
-               
-            g2.draw(new Line2D.Double(
-                       centerx + (v1.x + movex) * centerz / (centerz - v1.y), 
-                       centery - (v1.z + movez) * centerz / (centerz - v1.y), 
-                       centerx + (v2.x + movex) * centerz / (centerz - v2.y), 
-                       centery - (v2.z + movez) * centerz / (centerz - v2.y)));
-        }
-        
-
-               // Now we also draw the acceleration:
-               g2.setColor(Color.GREEN);
-               Vector v1 = new Vector(0,0,0);
-               Vector v2 = new Vector(accelx, accely, accelz);
-               v2.scale(20 * ginverse);
+        for (int i=0; i<vector_len; i+=2) {    
+               if (i==0) g2.setColor(Color.RED);
+               if (i==24) g2.setColor(Color.BLUE);
+               if (i==32) g2.setColor(Color.BLACK);
+               
+               Vector v1 = new Vector(phone[i]);
+               Vector v2 = new Vector(phone[i+1]);
+               if( i == 0 ) {
+                       v1.setAxisX(gyro_axisX);
+                       v1.setAxisY(gyro_axisY);
+                       v1.setAxisZ(gyro_axisZ);
+                       v1.rollpitchyaw(draw_roll, draw_pitch, draw_yaw);
+               }
+       
                v1.setPosition();
                v2.setPosition();
-               g2.draw(new Line2D.Double(
+               
+               if (phone_pos_conv == true) {
+                       if( i == vector_len - 2){
+                               phone_pos_conv = false;
+                               
+                               gyro_axisX = Vector.getAxisX().clone();
+                               gyro_axisY = Vector.getAxisY().clone();
+                               gyro_axisZ = Vector.getAxisZ().clone();
+                               
+                               old_gyro_rollDegree = rollDegree;
+                               old_gyro_pitchDegree = pitchDegree;
+                               old_gyro_yawDegree = yawDegree;
+                       }
+               }
+               
+               g2.draw(new Line2D.Double(
                                centerx + (v1.x + movex) * centerz / (centerz - v1.y), 
                                centery - (v1.z + movez) * centerz / (centerz - v1.y), 
                                centerx + (v2.x + movex) * centerz / (centerz - v2.y), 
                                centery - (v2.z + movez) * centerz / (centerz - v2.y)));
-               
+               
+               if (i==32)
+                       g2.drawString(" x+", (float)(centerx + (v1.x + movex) * centerz / (centerz - v1.y)), (float)(centery - (v1.z + movez) * centerz / (centerz - v1.y)));
+               
+               if (i==34)
+                       g2.drawString(" y+", (float)(centerx + (v1.x + movex) * centerz / (centerz - v1.y)), (float)(centery - (v1.z + movez) * centerz / (centerz - v1.y)));
+               
+               if (i==36)
+                       g2.drawString(" z+", (float)(centerx + (v1.x + movex) * centerz / (centerz - v1.y)), (float)(centery - (v1.z + movez) * centerz / (centerz - v1.y)));
+        }
+
+               // Now we also draw the acceleration:
+//             g2.setColor(Color.GREEN);
+//             Vector v1 = new Vector(0,0,0);
+//             Vector v2 = new Vector(accelx, accely, accelz);
+//             v2.scale(20 * ginverse);
+//             v1.setPosition();
+//             v2.setPosition();
+//             g2.draw(new Line2D.Double(
+//                             centerx + (v1.x + movex) * centerz / (centerz - v1.y), 
+//                             centery - (v1.z + movez) * centerz / (centerz - v1.y), 
+//                             centerx + (v2.x + movex) * centerz / (centerz - v2.y), 
+//                             centery - (v2.z + movez) * centerz / (centerz - v2.y)));
     }  
     
     @Override
@@ -924,8 +983,8 @@ private void updateSensorGyro(){
        public void connect() {
                connected = true;
                
-               accelerometerTimer(mPage.checkboxAccelerometer.getSelection());
-               geomagneticTimer(mPage.checkboxGeoMagnetic.getSelection());
+               accelerometerTimer(mPage.checkboxAcceleration.getSelection());
+               geomagneticTimer(mPage.checkboxMagnetic.getSelection());
                gyroTimer(mPage.checkboxGyro.getSelection());
                if( mPage.dataOutputTimer != null){
                        mPage.dataOutputTimer.start();
@@ -949,21 +1008,20 @@ private void updateSensorGyro(){
 
        @Override
        public void selectionChanged(FileEntry selectedEntry) {
-               if( selectedEntry == null)
-               {
-                       disconnect();
-                       return;
-               }
-               else if (!selectedEntry.getFileListingService().getDevice().isEmulator())
-                       return;
-               
-               if(currentDevice == null && selectedEntry.getName() != null)
-                       connect();
-               else if(currentDevice == null && selectedEntry.getName() == null)
-                       return;
-               else if (currentDevice.getSerialNumber() != selectedEntry.getName()) {
+               if (selectedEntry == null) {
                        disconnect();
-                       connect();
+               } else {
+                       String selectedName = selectedEntry.getDevice().getSerialNumber();
+                       if (currentDevice == null) {
+                               if (selectedName != null) {
+                                       connect();
+                               }
+                       } else {
+                               if (currentDevice.getSerialNumber() != selectedName) {
+                                       disconnect();
+                                       connect();
+                               }
+                       }
                }
        }
 }
@@ -1,12 +1,12 @@
 /*
- * org.tizen.sensor.accelerometer
+ * org.tizen.injector.sensor.accelerometer
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.sensor.magnetic;
+package org.tizen.injector.sensor.magnetic;
 
 import java.util.Random;
 
-import org.tizen.sensor.accelerometer.page.Vector;
+import org.tizen.injector.sensor.accelerometer.page.Vector;
 
 public class Magnetic {
        private static Magnetic instance;
@@ -40,13 +40,9 @@ public class Magnetic {
        private int azimuth = 0;
        private int pitch = -90;
        private int roll = 0;
-//     private double magneticnorth = 22874.1;
-//     private double magneticeast = 5939.5;
-//     private double magneticvertical = 43180.5;
        private double magneticnorth = 10000;
        private double magneticeast = 1000;
        private double magneticvertical = 0;
-       public static final String sensorNumber = "5\n";
        
        /** Current read-out value of compass x-component. */
        private double read_compassx;
@@ -105,13 +101,8 @@ public class Magnetic {
        
        public void updateSensorPhysics(double rollDegree, double pitchDegree, double yawDegree){
                // user input
-               
                double random = 0.0f;
-               
                Vector vec;
-               
-
-
                // Add random component:
                if (random > 0) {
                        magneticnorth += getRandom(random);
@@ -132,21 +123,16 @@ public class Magnetic {
                compassz = vec.z;
        }
        
-       public void setOrient(double x, double y, double z){
-               /* orientation logic via accelerometer value */
-               int orient_yaw, orient_pitch, orient_roll;
-               orient_yaw = (int)(Math.round(Math.atan2(-x, -y) * (180.0/3.14) + 360) % 360);
-               orient_pitch = (int)(Math.atan2(-y, -z) * (180.0/3.14)) % 180;
-               orient_roll = (int)(Math.atan2(x, z) * (180.0/3.14)) % 180;
-               
-               if(orient_roll > 90)
-                       orient_roll = 180 - orient_roll;
-               else if(orient_roll < -90)
-                       orient_roll = -180 - orient_roll;
+       public void setTilt(double x, double y, double z){
+               /* tilt logic via accelerometer value */
+               int tilt_yaw, tilt_pitch, tilt_roll;
+               tilt_yaw = (int)(Math.round(Math.atan2(-x, -y) * (180.0/3.14) + 360) % 360);
+               tilt_pitch = (int)(Math.atan2(x, -y) * (180.0/3.14));
+               tilt_roll = (int)(Math.atan2(x, -z) * (180.0/3.14)) % 180;
                
-               azimuth = orient_yaw;
-               pitch = -orient_pitch;
-               roll = orient_roll;
+               azimuth = tilt_yaw;
+               pitch = tilt_pitch;
+               roll = tilt_roll;
        }
        
        public int getAzimuth(){
diff --git a/org.tizen.injector.sensor.light/.project b/org.tizen.injector.sensor.light/.project
new file mode 100644 (file)
index 0000000..6f03311
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.tizen.injector.sensor.light</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+       </natures>
+</projectDescription>
@@ -1,16 +1,17 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Tizen Event Injector Sensor Light
-Bundle-SymbolicName: org.tizen.sensor.light;singleton:=true
+Bundle-SymbolicName: org.tizen.injector.sensor.light;singleton:=true
 Bundle-Version: 1.0.0.qualifier
-Bundle-Vendor: Samsung
+Bundle-Vendor: The Linux Foundation
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Import-Package: 
  org.eclipse.swt.widgets,
  org.eclipse.ui.plugin,
  org.tizen.common.connection,
  org.tizen.common.util,
- org.tizen.sdblib
+ org.tizen.sdblib,
+ org.tizen.sdblib.service
 Require-Bundle: org.tizen.injector,
  org.eclipse.swt;bundle-version="3.5.2",
  org.eclipse.core.runtime;bundle-version="3.7.0",
similarity index 71%
rename from org.tizen.sensor.light/plugin.xml
rename to org.tizen.injector.sensor.light/plugin.xml
index c83cad3..4013696 100644 (file)
@@ -5,8 +5,8 @@
          point="org.tizen.injector.injectorItemProvider">
       <itemType
             category="Sensor"
-            class="org.tizen.sensor.light.Light"
-            id="org.tizen.sensor.light"
+            class="org.tizen.injector.sensor.light.Light"
+            id="org.tizen.injector.sensor.light"
             name="Light">
       </itemType>
    </extension>
@@ -1,12 +1,12 @@
 /*
- * org.tizen.sensor.light
+ * org.tizen.injector.sensor.light
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.sensor.light;
+package org.tizen.injector.sensor.light;
 
 import org.tizen.injector.provider.AbstractInjectorItem;
-import org.tizen.sensor.light.page.LightPage;
+import org.tizen.injector.sensor.light.page.LightPage;
 
 public class Light extends AbstractInjectorItem{
 
diff --git a/org.tizen.injector.sensor.light/src/org/tizen/injector/sensor/light/page/LightPage.java b/org.tizen.injector.sensor.light/src/org/tizen/injector/sensor/light/page/LightPage.java
new file mode 100644 (file)
index 0000000..fe02d43
--- /dev/null
@@ -0,0 +1,265 @@
+/*
+ * org.tizen.injector.sensor.light
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.sensor.light.page;
+
+import java.io.IOException;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Slider;
+import org.eclipse.swt.widgets.Text;
+import org.tizen.common.connection.ConnectionPlugin;
+import org.tizen.common.connection.ConnectionPlugin.ISelectionListener;
+import org.tizen.injector.InjectorDialog;
+import org.tizen.injector.protocol.sensor.TestSensorMessage;
+import org.tizen.injector.provider.AbstractInjectorItem;
+import org.tizen.injector.provider.AbstractInjectorPage;
+import org.tizen.injector.view.InjectorView;
+import org.tizen.sdblib.IDevice;
+import org.tizen.sdblib.service.FileEntry;
+
+public class LightPage extends AbstractInjectorPage implements ISelectionListener {
+       private Text sliderText;
+       private Text luxText;
+       private Button injectLux;
+       private Slider slider;
+       private final String sensorNumber = "3\n";
+       private final String lightLevel = "Level";
+       private int luxData = 65535, levelData = 10;
+       private IDevice currentDevice;
+       
+       public LightPage(AbstractInjectorItem item, String name) {
+               super(item, name);
+       }
+
+       public static boolean checkNumberFormat(String noStr) {
+               Pattern luxPattern = Pattern.compile( "[^0-9]");
+               Matcher matcher = luxPattern.matcher(noStr);
+               return matcher.find();
+       }
+       
+       @Override
+       protected void createContents() {
+               InjectorView.getDefault().addSelectionListener(this);
+               currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
+               Composite mainComposite = formUtil.createComposite(parent, 4);
+               GridData gd = new GridData(GridData.FILL, GridData.FILL, false, true);
+               gd.widthHint = 560;
+               mainComposite.setLayoutData(gd);
+
+               formUtil.createLabel(mainComposite, "Lux  ");
+               slider = formUtil.createSlider(mainComposite);
+               gd = new GridData(SWT.NONE, SWT.CENTER, false, true);
+               gd.widthHint = 460;
+               slider.setLayoutData(gd);
+               setDefaultSlider(slider);
+               slider.setSelection(luxData);
+               slider.addSelectionListener(new SelectionListener() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               int sliderValue;
+                               sliderValue = slider.getSelection();
+                               luxData = sliderValue;
+                               luxText.setText(Integer.toString(luxData));
+                       }
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
+               });
+               
+               slider.addMouseListener(new MouseListener() {
+                       @Override
+                       public void mouseDoubleClick(MouseEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+                       @Override
+                       public void mouseDown(MouseEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+                       @Override
+                       public void mouseUp(MouseEvent e) {
+                               // TODO Auto-generated method stub
+                               setLevelData();
+                               sendMessage(1, levelData);
+                               sendMessage(2, luxData);
+                       }
+               });
+               
+               slider.addKeyListener(new KeyListener() {
+                       @Override
+                       public void keyPressed(KeyEvent e) {
+                               // TODO Auto-generated method stub
+                       }
+                       @Override
+                       public void keyReleased(KeyEvent e) {
+                               // TODO Auto-generated method stub
+                               setLevelData();
+                               sendMessage(1, levelData);
+                               sendMessage(2, luxData);
+                       }
+               });
+               
+               luxData = slider.getSelection();
+               luxText = formUtil.createText(mainComposite, "" + luxData);
+               
+               luxText.setTextLimit(5);
+               luxText.addSelectionListener(new SelectionListener() {
+
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               
+                       }
+
+                       @Override
+                       public void widgetDefaultSelected(SelectionEvent e) {
+                               // TODO Auto-generated method stub
+                               String number = luxText.getText().trim();
+                               if(number==null||number.length()==0)
+                                       return;
+                               
+                               try {
+                                       if(checkNumberFormat(number) || Double.parseDouble(number) <= 0 || Double.parseDouble(number) > 65535)
+                                               throw null;
+                               } catch (NumberFormatException err) {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter an positive integer number of units.\nLux can be entered in the range of 1 to 65535.");
+                                       luxText.setText(Integer.toString(luxData));
+                                       return;
+                               } catch (Exception err) {
+                                       Shell shell = parent.getShell();
+                                       InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Please enter an positive integer number of units.\nLux can be entered in the range of 1 to 65535.");
+                                       luxText.setText(Integer.toString(luxData));
+                                       return;
+                               }
+                               
+                               luxData = Integer.parseInt(number);
+                               slider.setSelection(luxData);
+                               setLevelData();
+                               
+                               sendMessage(1, levelData);
+                               sendMessage(2, luxData);
+                       }
+               });
+               
+               boolean connected = checkDeviceConnectedAlready();
+               if (connected == true) {
+                       connect();
+               }
+       }
+
+       private void setLevelData() {
+               levelData = (luxData / 6554) % 10 + 1;
+       }
+       
+       private void setDefaultSlider(Slider slider) {
+           slider.setMinimum(1);
+           slider.setMaximum(65536);
+           slider.setIncrement(1);
+           slider.setThumb(1);
+       }
+       
+       private boolean checkDeviceConnectedAlready() {
+               if (currentDevice == null)
+                       return false;
+               else
+                       return true;
+       }
+       
+       @Override
+       protected void registerReceivers() {
+               // TODO Auto-generated method stub
+               
+       }
+       
+       public void sendMessage(int label, int data) {
+                       TestSensorMessage msg = new TestSensorMessage(label, data);
+                       try {
+                               injectorSocket.sendSensor(sensorNumber + msg.getMessage());
+                       } catch (IOException e1) {
+                               e1.printStackTrace();
+                       } catch (Exception e1) {
+                               // TODO Auto-generated catch block
+                               e1.printStackTrace();
+                       }
+       }
+
+//     @Override
+       public void connect() {
+               // TODO Auto-generated method stub
+               currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
+               setLevelData();
+               sendMessage(1, levelData);
+               sendMessage(2, luxData);
+       }
+
+//     @Override
+       public void disconnect() {
+               // TODO Auto-generated method stub
+       }
+       
+    @Override
+    protected void finalize() throws Throwable {
+       InjectorView.getDefault().removeSelectionListener(this);
+//     TargetConnectionControl.removeTargetConnectionListener(this);
+       super.finalize();
+    }
+
+       @Override
+       public void selectionChanged(FileEntry selectedEntry) {
+               if (selectedEntry == null) {
+                       disconnect();
+               } else {
+                       String selectedName = selectedEntry.getDevice().getSerialNumber();
+                       if (currentDevice == null) {
+                               if (selectedName != null) {
+                                       connect();
+                               }
+                       } else {
+                               if (currentDevice.getSerialNumber() != selectedName) {
+                                       disconnect();
+                                       connect();
+                               }
+                       }
+               }
+       }
+}
diff --git a/org.tizen.injector.sensor.motion/.project b/org.tizen.injector.sensor.motion/.project
new file mode 100644 (file)
index 0000000..02ff069
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.tizen.injector.sensor.motion</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+       </natures>
+</projectDescription>
@@ -1,9 +1,9 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Tizen Event Injector Sensor Motion
-Bundle-SymbolicName: org.tizen.sensor.motion;singleton:=true
+Bundle-SymbolicName: org.tizen.injector.sensor.motion;singleton:=true
 Bundle-Version: 1.0.0.qualifier
-Bundle-Vendor: Samsung
+Bundle-Vendor: The Linux Foundation
 Require-Bundle: org.eclipse.core.runtime,
  org.eclipse.swt,
  org.tizen.injector
@@ -11,5 +11,6 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Import-Package: org.tizen.injector.provider,
  org.tizen.common.connection,
  org.tizen.sdblib,
+ org.tizen.sdblib.service,
  org.eclipse.swt,
  org.eclipse.ui.plugin
similarity index 70%
rename from org.tizen.sensor.motion/plugin.xml
rename to org.tizen.injector.sensor.motion/plugin.xml
index 429250f..941c8f3 100644 (file)
@@ -5,8 +5,8 @@
          point="org.tizen.injector.injectorItemProvider">
       <itemType
             category="Sensor"
-            class="org.tizen.sensor.motion.Motion"
-            id="org.tizen.sensor.motion"
+            class="org.tizen.injector.sensor.motion.Motion"
+            id="org.tizen.injector.sensor.motion"
             name="Motion">
       </itemType>
    </extension>
@@ -1,12 +1,12 @@
 /*
- * org.tizen.sensor.motion
+ * org.tizen.injector.sensor.motion
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.sensor.motion;
+package org.tizen.injector.sensor.motion;
 
 import org.tizen.injector.provider.AbstractInjectorItem;
-import org.tizen.sensor.motion.page.MotionPage;
+import org.tizen.injector.sensor.motion.page.MotionPage;
 
 public class Motion extends AbstractInjectorItem{
 
@@ -1,12 +1,12 @@
 /*
- * org.tizen.sensor.motion
+ * org.tizen.injector.sensor.motion
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.sensor.motion.page;
+package org.tizen.injector.sensor.motion.page;
 
 
+import java.io.IOException;
+
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
@@ -35,10 +37,10 @@ import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.tizen.common.connection.ConnectionPlugin.ISelectionListener;
-import org.tizen.sdblib.FileListingService.FileEntry;
 import org.tizen.injector.protocol.sensor.TestSensorMessage;
 import org.tizen.injector.provider.AbstractInjectorItem;
 import org.tizen.injector.provider.AbstractInjectorPage;
+import org.tizen.sdblib.service.FileEntry;
 
 public class MotionPage extends AbstractInjectorPage implements ISelectionListener {
        private final String sensorNumber = "6\n";
@@ -49,7 +51,10 @@ public class MotionPage extends AbstractInjectorPage implements ISelectionListen
 
        @Override
        protected void createContents() {
-               Composite mainComposite = formUtil.createComposite(parent, 3);
+               Composite mainComposite = formUtil.createComposite(parent, 5);
+               GridData gd = new GridData(GridData.FILL, GridData.FILL, false, true);
+               gd.widthHint = 600;
+               mainComposite.setLayoutData(gd);
                
                Button button_doubleTap = formUtil.createButton(mainComposite, "Double Tap", SWT.PUSH);
                Button button_shakeStart = formUtil.createButton(mainComposite, "Shake Start", SWT.PUSH);
@@ -60,11 +65,12 @@ public class MotionPage extends AbstractInjectorPage implements ISelectionListen
                Button button_snapXm = formUtil.createButton(mainComposite, "Snap X-", SWT.PUSH);
                Button button_snapYm = formUtil.createButton(mainComposite, "Snap Y-", SWT.PUSH);
                Button button_snapZm = formUtil.createButton(mainComposite, "Snap Z-", SWT.PUSH);
-               Button button_snapLeft = formUtil.createButton(mainComposite, "Snap Left", SWT.PUSH);
-               Button button_snapRight = formUtil.createButton(mainComposite, "Snap Right", SWT.PUSH);
-
-               GridData gd = new GridData(GridData.FILL, GridData.FILL, true, false);
+//             Button button_snapLeft = formUtil.createButton(mainComposite, "Snap Left", SWT.PUSH);
+//             Button button_snapRight = formUtil.createButton(mainComposite, "Snap Right", SWT.PUSH);
+               Button button_moveToCall = formUtil.createButton(mainComposite, "Move To Ear", SWT.PUSH);
 
+               gd = new GridData(GridData.FILL, GridData.FILL, false, true);
+               gd.widthHint = 110;
                button_doubleTap.setLayoutData(gd);
                button_shakeStart.setLayoutData(gd);
                button_shakeEnd.setLayoutData(gd);
@@ -74,8 +80,9 @@ public class MotionPage extends AbstractInjectorPage implements ISelectionListen
                button_snapYm.setLayoutData(gd);
                button_snapZp.setLayoutData(gd);
                button_snapZm.setLayoutData(gd);
-               button_snapLeft.setLayoutData(gd);
-               button_snapRight.setLayoutData(gd);
+//             button_snapLeft.setLayoutData(gd);
+//             button_snapRight.setLayoutData(gd);
+               button_moveToCall.setLayoutData(gd);
                
                button_doubleTap.addSelectionListener(new SelectionListener(){
                        @Override
@@ -158,22 +165,31 @@ public class MotionPage extends AbstractInjectorPage implements ISelectionListen
                                sendMessage(9);
                        }
            });
-               button_snapLeft.addSelectionListener(new SelectionListener(){
-                       @Override
-                       public void widgetDefaultSelected(SelectionEvent e) {
-                       }
-                       @Override
-                       public void widgetSelected(SelectionEvent e) {
-                               sendMessage(10);
-                       }
-           });
-               button_snapRight.addSelectionListener(new SelectionListener(){
+//             button_snapLeft.addSelectionListener(new SelectionListener(){
+//                     @Override
+//                     public void widgetDefaultSelected(SelectionEvent e) {
+//                     }
+//                     @Override
+//                     public void widgetSelected(SelectionEvent e) {
+//                             sendMessage(10);
+//                     }
+//         });
+//             button_snapRight.addSelectionListener(new SelectionListener(){
+//                     @Override
+//                     public void widgetDefaultSelected(SelectionEvent e) {
+//                     }
+//                     @Override
+//                     public void widgetSelected(SelectionEvent e) {
+//                             sendMessage(11);
+//                     }
+//         });
+               button_moveToCall.addSelectionListener(new SelectionListener(){
                        @Override
                        public void widgetDefaultSelected(SelectionEvent e) {
                        }
                        @Override
                        public void widgetSelected(SelectionEvent e) {
-                               sendMessage(11);
+                               sendMessage(12);
                        }
            });
        }
@@ -188,6 +204,8 @@ public class MotionPage extends AbstractInjectorPage implements ISelectionListen
                try {
                //      sensorSocket.send(sensorNumber + msg.getMessage());
                        injectorSocket.sendSensor(sensorNumber + msg.getMessage());
+               } catch (IOException e1) {
+                       e1.printStackTrace();
                } catch (Exception e1) {
                        // TODO Auto-generated catch block
                        e1.printStackTrace();
diff --git a/org.tizen.injector.sensor.proximity/.project b/org.tizen.injector.sensor.proximity/.project
new file mode 100644 (file)
index 0000000..e2bcd16
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.tizen.injector.sensor.proximity</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+       </natures>
+</projectDescription>
@@ -1,9 +1,9 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Tizen Event Injector Sensor Proximity
-Bundle-SymbolicName: org.tizen.sensor.proximity;singleton:=true
+Bundle-SymbolicName: org.tizen.injector.sensor.proximity;singleton:=true
 Bundle-Version: 1.0.0.qualifier
-Bundle-Vendor: Samsung
+Bundle-Vendor: The Linux Foundation
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Require-Bundle: org.tizen.injector,
  org.eclipse.swt,
@@ -14,4 +14,5 @@ Import-Package:
  org.eclipse.swt,
  org.eclipse.swt.widgets,
  org.tizen.common.connection,
- org.tizen.sdblib
+ org.tizen.sdblib,
+ org.tizen.sdblib.service
similarity index 69%
rename from org.tizen.sensor.proximity/plugin.xml
rename to org.tizen.injector.sensor.proximity/plugin.xml
index 222d6f4..7aacfa5 100644 (file)
@@ -5,8 +5,8 @@
          point="org.tizen.injector.injectorItemProvider">
       <itemType
             category="Sensor"
-            class="org.tizen.sensor.proximity.Proximity"
-            id="org.tizen.sensor.proximity"
+            class="org.tizen.injector.sensor.proximity.Proximity"
+            id="org.tizen.injector.sensor.proximity"
             name="Proximity">
       </itemType>
    </extension>
@@ -1,12 +1,12 @@
 /*
- * org.tizen.sensor.proximity
+ * org.tizen.injector.sensor.proximity
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.sensor.proximity;
+package org.tizen.injector.sensor.proximity;
 
 import org.tizen.injector.provider.AbstractInjectorItem;
-import org.tizen.sensor.proximity.page.ProximityPage;
+import org.tizen.injector.sensor.proximity.page.ProximityPage;
 
 public class Proximity extends AbstractInjectorItem{
 
@@ -1,12 +1,12 @@
 /*
- * org.tizen.sensor.proximity
+ * org.tizen.injector.sensor.proximity
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -25,9 +25,9 @@
  * 
  */
 
-package org.tizen.sensor.proximity.page;
+package org.tizen.injector.sensor.proximity.page;
 
 public class ProximityConstants {
-       public static final String ON = "Near";
-       public static final String OFF = "Far";
+       public static final String ON = "ON";
+       public static final String OFF = "OFF";
 }
@@ -1,12 +1,12 @@
 /*
- * org.tizen.sensor.proximity
+ * org.tizen.injector.sensor.proximity
  * 
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * 
  */
 
-package org.tizen.sensor.proximity.page;
+package org.tizen.injector.sensor.proximity.page;
 
-import org.eclipse.swt.events.MouseEvent;
-//import org.eclipse.swt.events.SelectionEvent;
-//import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.layout.GridData;
+import java.io.IOException;
 
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Slider;
-import org.eclipse.swt.widgets.Text;
 import org.eclipse.swt.SWT;
-
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
 import org.tizen.common.connection.ConnectionPlugin;
 import org.tizen.common.connection.ConnectionPlugin.ISelectionListener;
-import org.tizen.sdblib.FileListingService.FileEntry;
-import org.tizen.sdblib.IDevice;
 import org.tizen.injector.protocol.sensor.TestSensorMessage;
 import org.tizen.injector.provider.AbstractInjectorItem;
 import org.tizen.injector.provider.AbstractInjectorPage;
 import org.tizen.injector.view.InjectorView;
+import org.tizen.sdblib.IDevice;
+import org.tizen.sdblib.service.FileEntry;
 
 public class ProximityPage extends AbstractInjectorPage implements ISelectionListener {
-       private Text sliderText;
-       private Slider slider;
        private final String sensorNumber = "2\n";
-       private final String proxiDistance = "Distance";
-       private int sendData;
        private IDevice currentDevice = null;
+       private Button radioButton[];
+       private int proximity_status;
        
        public ProximityPage(AbstractInjectorItem item, String name) {
                super(item, name);
@@ -65,46 +59,29 @@ public class ProximityPage extends AbstractInjectorPage implements ISelectionLis
                InjectorView.getDefault().addSelectionListener(this);
                currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
 
-               Composite mainComposite = formUtil.createComposite(parent, 3);
-               formUtil.createLabel(mainComposite, proxiDistance);
-               slider = formUtil.createSlider(mainComposite, SWT.HORIZONTAL);
-               slider.setValues(8, 0, 9, 1, 1, 1);
-               slider.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
-               sliderText = formUtil.createText(mainComposite, Integer.toString(slider.getSelection()));
-               sliderText.setEditable(false);
-               GridData gd = new GridData(GridData.BEGINNING, GridData.CENTER, false, false);
-               gd.widthHint = 20;
-               sliderText.setLayoutData(gd);
-               sendData = slider.getSelection();
-               /*
-               slider.addSelectionListener(new SelectionListener() {
-                       @Override
-                       public void widgetDefaultSelected(SelectionEvent e) {
-                               // TODO Auto-generated method stub
-                       }
+               Composite mainComposite = formUtil.createComposite(parent, 2);
+               radioButton = new Button[2];
+               radioButton[0] = formUtil.createButton(mainComposite, ProximityConstants.ON, SWT.RADIO);
+               radioButton[1] = formUtil.createButton(mainComposite, ProximityConstants.OFF, SWT.RADIO);
+               radioButton[1].setSelection(true);
+               proximity_status = 8;
+               
+               radioButton[0].addSelectionListener(new SelectionAdapter() {
                        @Override
                        public void widgetSelected(SelectionEvent e) {
-                               sendData = slider.getSelection();
-                               sliderText.setText(Integer.toString(sendData));
-                               sendMessage(sendData);
-                       }
+                               proximity_status = 0;
+                               super.widgetSelected(e);
+                               sendMessage(proximity_status);
+                               }
                });
-               */
-
-               slider.addMouseListener(new MouseListener() {
-                       @Override
-                       public void mouseDoubleClick(MouseEvent e) {
-                       }
-                       @Override
-                       public void mouseDown(MouseEvent e) {
-                       }
+               
+               radioButton[1].addSelectionListener(new SelectionAdapter() {
                        @Override
-                       public void mouseUp(MouseEvent e) {
-                               sendData = slider.getSelection();
-                               slider.setSelection(sendData);
-                               sliderText.setText(Integer.toString(sendData));
-                               sendMessage(sendData);
-                       }
+                       public void widgetSelected(SelectionEvent e) {
+                               proximity_status = 8;
+                               super.widgetSelected(e);
+                               sendMessage(proximity_status);
+                               }
                });
                
                boolean connected = checkDeviceConnectedAlready();
@@ -131,6 +108,8 @@ public class ProximityPage extends AbstractInjectorPage implements ISelectionLis
                        try {
                        //      sensorSocket.send(sensorNumber + msg.getMessage());
                                injectorSocket.sendSensor(sensorNumber + msg.getMessage());
+                       } catch (IOException e1) {
+                               e1.printStackTrace();
                        } catch (Exception e1) {
                                // TODO Auto-generated catch block
                                e1.printStackTrace();
@@ -141,10 +120,7 @@ public class ProximityPage extends AbstractInjectorPage implements ISelectionLis
        public void connect() {
                // TODO Auto-generated method stub
                currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
-       
-               slider.setSelection(8);
-               sendData = slider.getSelection();
-               sliderText.setText(Integer.toString(sendData));
+               sendMessage(proximity_status);
        }
 
 //     @Override
@@ -160,22 +136,20 @@ public class ProximityPage extends AbstractInjectorPage implements ISelectionLis
 
        @Override
        public void selectionChanged(FileEntry selectedEntry) {
-               if( selectedEntry == null)
-               {
+               if (selectedEntry == null) {
                        disconnect();
-                       return;
-               }
-               else if (!selectedEntry.getFileListingService().getDevice().isEmulator())
-                       return;
-               
-               if(currentDevice == null && selectedEntry.getName() != null)
-                       connect();
-               else if(currentDevice == null && selectedEntry.getName() == null)
-                       return;
-               else if (currentDevice.getSerialNumber() != selectedEntry.getName()) {
-                       disconnect();
-                       connect();
+               } else {
+                       String selectedName = selectedEntry.getDevice().getSerialNumber();
+                       if (currentDevice == null) {
+                               if (selectedName != null) {
+                                       connect();
+                               }
+                       } else {
+                               if (currentDevice.getSerialNumber() != selectedName) {
+                                       disconnect();
+                                       connect();
+                               }
+                       }
                }
-               sendMessage(sendData);
        }
 }
diff --git a/org.tizen.injector.telephony.call/.classpath b/org.tizen.injector.telephony.call/.classpath
new file mode 100644 (file)
index 0000000..ad32c83
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+       <classpathentry kind="src" path="src"/>
+       <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.tizen.injector.telephony.call/.project b/org.tizen.injector.telephony.call/.project
new file mode 100644 (file)
index 0000000..a928105
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.tizen.injector.telephony.call</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+       </natures>
+</projectDescription>
diff --git a/org.tizen.injector.telephony.call/.settings/org.eclipse.core.resources.prefs b/org.tizen.injector.telephony.call/.settings/org.eclipse.core.resources.prefs
new file mode 100644 (file)
index 0000000..7bc7400
--- /dev/null
@@ -0,0 +1,3 @@
+#Wed Dec 01 09:09:12 CET 2010
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/org.tizen.injector.telephony.call/.settings/org.eclipse.core.runtime.prefs b/org.tizen.injector.telephony.call/.settings/org.eclipse.core.runtime.prefs
new file mode 100644 (file)
index 0000000..75c8101
--- /dev/null
@@ -0,0 +1,3 @@
+#Tue Dec 14 16:31:45 CET 2010
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/org.tizen.injector.telephony.call/META-INF/MANIFEST.MF b/org.tizen.injector.telephony.call/META-INF/MANIFEST.MF
new file mode 100644 (file)
index 0000000..3b27128
--- /dev/null
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Tizen Event Injector Telephony Call
+Bundle-SymbolicName: org.tizen.injector.telephony.call;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: The Linux Foundation
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.ui.forms;bundle-version="3.3.103",
+ org.tizen.common,
+ org.eclipse.ui.views;bundle-version="3.3.1",
+ org.tizen.injector,
+ org.tizen.common.connection
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Export-Package: org.tizen.injector.telephony.call,
+ org.tizen.injector.telephony.call.page
+Import-Package: org.tizen.sdblib,
+ org.tizen.sdblib.service
diff --git a/org.tizen.injector.telephony.call/build.properties b/org.tizen.injector.telephony.call/build.properties
new file mode 100644 (file)
index 0000000..663e43b
--- /dev/null
@@ -0,0 +1,6 @@
+source.. = src/\r
+output.. = bin/\r
+bin.includes = plugin.xml,\\r
+               META-INF/,\\r
+               .\rjavacSource = 1.6
+javacTarget = 1.6
diff --git a/org.tizen.injector.telephony.call/icons/telephony_view.png b/org.tizen.injector.telephony.call/icons/telephony_view.png
new file mode 100644 (file)
index 0000000..d87e1cb
Binary files /dev/null and b/org.tizen.injector.telephony.call/icons/telephony_view.png differ
diff --git a/org.tizen.injector.telephony.call/plugin.xml b/org.tizen.injector.telephony.call/plugin.xml
new file mode 100644 (file)
index 0000000..bb1182d
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+       <extension
+         point="org.tizen.injector.injectorItemProvider">
+      <itemType
+               category="Telephony"
+            class="org.tizen.injector.telephony.call.TelephonyCall"
+            id="org.tizen.injector.telephony.call.TelephonyCall"
+            name="Telephony Call">
+      </itemType>
+   </extension>
+</plugin>
diff --git a/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/TelephonyCall.java b/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/TelephonyCall.java
new file mode 100644 (file)
index 0000000..377a897
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * org.tizen.injector.telephony.call
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.call;
+
+import java.util.ArrayList;
+
+import org.eclipse.jface.viewers.TableViewer;
+
+import org.tizen.injector.model.DefaultTableModel;
+import org.tizen.injector.provider.AbstractInjectorItem;
+import org.tizen.injector.telephony.call.model.CallListVO;
+import org.tizen.injector.telephony.call.page.MOMTCall;
+
+public class TelephonyCall extends AbstractInjectorItem {
+       private static MOMTCall callinstance = null;
+       private DefaultTableModel model = new DefaultTableModel(new CallListVO());
+       @Override
+       protected void addPages() {
+               callinstance = new MOMTCall(this, "CALL", model);
+               addPage(callinstance);
+//             addPage(new RemoteParty(this, "Remote Party", model));
+       }
+       
+       private ArrayList<TableViewer> viewerList = new ArrayList<TableViewer>();
+       public void addViewer(TableViewer viewer){
+               viewerList.add(viewer);
+       }
+       
+       public void refresh(){
+               for(int i=0;i<viewerList.size();i++){
+                       viewerList.get(i).refresh();
+               }
+       }
+       
+       public static MOMTCall getinstance() {
+               return callinstance;
+       }
+}
diff --git a/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/model/CallListVO.java b/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/model/CallListVO.java
new file mode 100644 (file)
index 0000000..bf80b7b
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * org.tizen.injector.telephony.call
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.call.model;
+
+import org.tizen.injector.model.AbstractTableVO;
+
+public class CallListVO extends AbstractTableVO {
+
+       private int callId;
+       private int status;
+       private int multiParty;
+       private int momt;
+       private String number;
+       
+       public int getCallId() {
+               return callId;
+       }
+
+       public void setCallId(int callId) {
+               this.callId = callId;
+       }
+
+       public int getStatus() {
+               return status;
+       }
+
+       public void setStatus(int status) {
+               this.status = status;
+       }
+
+       public int getMultiParty() {
+               return multiParty;
+       }
+
+       public void setMultiParty(int multiParty) {
+               this.multiParty = multiParty;
+       }
+
+       public int getMomt() {
+               return momt;
+       }
+
+       public void setMomt(int momt) {
+               this.momt = momt;
+       }
+
+       public String getNumber() {
+               return number;
+       }
+
+       public void setNumber(String number) {
+               this.number = number;
+       }
+
+       @Override
+       public String[] getColumnNames() {
+               return null;
+       }
+
+       @Override
+       public Object getColumnValue(int index) {
+               Object obj = null;
+               switch (index) {
+                       case 0:
+                               obj = getCallId();
+                               break;
+                       case 1:
+                               obj = getStatus();
+                               break;
+                       case 2:
+                               obj = getMultiParty();
+                               break;
+                       case 3:
+                               obj = getMomt();
+                               break;
+                       case 4:
+                               obj = getNumber();
+                               break;
+                       default:
+                               break;
+               }
+               return obj;
+       }
+
+       @Override
+       public void setColumnValue(int index, Object value) {
+
+       }
+}
diff --git a/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/page/MOMTCall.java b/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/page/MOMTCall.java
new file mode 100644 (file)
index 0000000..3dcb256
--- /dev/null
@@ -0,0 +1,793 @@
+/*
+ * org.tizen.injector.telephony.call
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.call.page;
+
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ComboBoxCellEditor;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.tizen.common.connection.ConnectionPlugin;
+import org.tizen.common.connection.ConnectionPlugin.ISelectionListener;
+import org.tizen.injector.InjectorDialog;
+import org.tizen.injector.control.TableViewContentProvider;
+import org.tizen.injector.control.TableViewLabelProvider;
+import org.tizen.injector.model.DefaultTableModel;
+import org.tizen.injector.protocol.AbstractGA;
+import org.tizen.injector.protocol.StructureGA;
+import org.tizen.injector.provider.AbstractInjectorItem;
+import org.tizen.injector.provider.AbstractInjectorPage;
+import org.tizen.injector.receiver.AbstractInjectorReceiver;
+import org.tizen.injector.socket.TelephonySocket;
+import org.tizen.injector.telephony.call.TelephonyCall;
+import org.tizen.injector.telephony.call.model.CallListVO;
+import org.tizen.injector.telephony.call.protocol.G01A07;
+import org.tizen.injector.telephony.call.protocol.G01A21MO;
+import org.tizen.injector.telephony.call.protocol.G01A21MT;
+import org.tizen.injector.telephony.call.protocol.G01A22;
+import org.tizen.injector.telephony.call.protocol.G01A22End;
+import org.tizen.injector.telephony.call.protocol.G01A23;
+import org.tizen.injector.telephony.call.protocol.G01A26;
+import org.tizen.injector.telephony.call.protocol.G01A29;
+import org.tizen.injector.telephony.call.protocol.G01A62;
+import org.tizen.injector.telephony.call.resource.ErrorCode;
+import org.tizen.injector.view.InjectorView;
+import org.tizen.sdblib.IDevice;
+import org.tizen.sdblib.service.FileEntry;
+
+public class MOMTCall  extends AbstractInjectorPage implements
+ISelectionListener{
+       boolean listfull = false;
+       boolean incomming = false;
+       boolean dialing = false;
+       boolean calling = false;
+       boolean isbtenabled = true;
+       private IDevice currentDevice;
+//     private boolean emulChange = false;
+       private boolean rssiStatus = true;
+
+       public static final int AT_CALL_STAT_ERR = -1;
+       public static final int AT_CALL_STAT_INCOMING = 4;
+       public static final int AT_CALL_STAT_WAITING = 5;
+
+       public void setRssiStatus(boolean status) {
+               rssiStatus = status;
+               if(!status)
+                       callEnd(true);
+       }
+       
+       public boolean getRssiStatus() {
+               return rssiStatus;
+       }
+       
+       public MOMTCall(AbstractInjectorItem item, String name) {
+               super(item, name);
+       }
+
+       public MOMTCall(AbstractInjectorItem item, String name, DefaultTableModel model) {
+               super(item, name);
+               this.model = model;
+       }
+
+       private final String[] CALL_TYPE_LIST = {
+                       "NONE", "VOICE", "DATA", "VIDEO", "MAX", "", "", "EMERGENCY"
+       };
+       
+       private String defaultErrorCode = "CALL OK(Success)";
+       private ErrorCode ERROR_CODE_LIST = new ErrorCode();
+       
+       private final String[] STATUS = { "ACTIVE", "HELD", "DIALING", "ALERT",
+                       "INCOMING", "WAITING", "MAX" };
+       private final String[] MO_MT = { "MO", "MT", "MAX" };
+       private final String[] MULTIPARTY = { "FALSE", "TRUE" };
+       
+       private Label lblMOCallCallId, lblMOCallNumber, lblMOCallCallType;
+       private Button butMOCall;
+       private Combo cmbMOCallCallStatus;
+       private int MOCallevent; //0 - alert, 1 - connect, 2 - disconnect 
+
+       private Text txtMTCallNumber;
+       private Button butMTCallHidden;
+       //private Button butMTCallForwardedCall;
+       private Button butMTCallConnect;
+       
+//     private Text txtCallListInformationCallId;
+       private Combo cmbCallListInformationCallStatus;
+       private Button butCallListInformationCallEnd;
+       
+       private TableViewer viewer;
+       private DefaultTableModel model;
+       
+       protected void registerReceivers() {
+               registerReceiver(new CallList22Receiver());
+               registerReceiver(new CallList26Receiver());
+               registerReceiver(new CallList29Receiver());
+               registerReceiver(new CallReceiver());
+       }
+       
+       protected void createContents() {
+               InjectorView.getDefault().addSelectionListener(this);
+               currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
+               createMTCallSection();
+               createCallListInformationSection();
+               createMOCallSection();
+               ((TelephonyCall)getParent()).addViewer(viewer);
+       }
+
+       private void createMOCallSection() {
+               Composite client = formUtil.createSection(parent, "MO Call (Mobile Origination)");
+               
+               Composite mainComposite = formUtil.createComposite(client, 2);
+               GridData gd = new GridData(GridData.FILL, GridData.FILL, false, true);
+               gd.widthHint = 580;
+               mainComposite.setLayoutData(gd);
+               
+//             String emptyStr = " ";
+               formUtil.createLabel(mainComposite, "Call ID : ");
+               lblMOCallCallId = formUtil.createLabel(mainComposite, "");
+               formUtil.setWidth(lblMOCallCallId, 350);
+               formUtil.createLabel(mainComposite, "Number : ");
+               lblMOCallNumber = formUtil.createLabel(mainComposite, "");
+               formUtil.setWidth(lblMOCallNumber, 350);
+               formUtil.createLabel(mainComposite, "Call Type : ");
+               lblMOCallCallType =  formUtil.createLabel(mainComposite, "");
+               formUtil.setWidth(lblMOCallCallType, 350);
+               
+               Composite subComposite = formUtil.createComposite(client, 2);
+               gd = new GridData(SWT.FILL, SWT.FILL, false, true);
+               gd.widthHint = 580;
+               subComposite.setLayoutData(gd);
+               cmbMOCallCallStatus = formUtil.createCombo(subComposite);
+               formUtil.setWidth(cmbMOCallCallStatus, 390);
+               cmbMOCallCallStatus.setEnabled(false);
+               formUtil.addComboItem(cmbMOCallCallStatus, ERROR_CODE_LIST.getErrorList(), defaultErrorCode);
+               butMOCall = formUtil.createButton(subComposite, "Disconnect", SWT.PUSH);
+               gd = new GridData(SWT.FILL, SWT.FILL, false, false);
+               gd.widthHint = 100;
+               butMOCall.setLayoutData(gd);
+               butMOCall.setEnabled(false);
+               MOCallevent = 0;
+               butMOCall.addSelectionListener(new SelectionAdapter(){
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               switch (MOCallevent) {
+                               case 0:
+                                       moAlert();
+                                       break;
+                               case 1:
+                                       moConnect();
+                                       break;
+                               default:
+                                       moDisconnect();
+                                       break;
+                               }
+                       }
+               });
+       }
+       
+       private void createMTCallSection() {
+               Composite client = formUtil.createSection(parent, "MT Call (Mobile Termination)");
+               
+               Composite mainComposite = formUtil.createComposite(client, 3);
+               GridData gd = new GridData(SWT.FILL, SWT.FILL, false, true);
+               gd.widthHint = 580;
+               mainComposite.setLayoutData(gd);
+               
+               formUtil.createLabel(mainComposite, "Number : ");
+               txtMTCallNumber = formUtil.createText(mainComposite, "");
+               formUtil.setWidth(txtMTCallNumber, 362);
+               Composite buttonComposite = formUtil.createComposite(mainComposite);
+               
+               formUtil.createLabel(mainComposite, "Call Type : ");
+               butMTCallHidden = formUtil.createButton(mainComposite, "Hidden", SWT.CHECK);
+//             butMTCallForwardedCall = formUtil.createButton(mainComposite, "Forwarded Call", SWT.CHECK);
+               
+//             Composite buttonComposite = formUtil.createComposite(client,1);
+               butMTCallConnect = formUtil.createButton(buttonComposite, "Connect", SWT.PUSH);
+               gd = new GridData(SWT.FILL, SWT.FILL, false, false);
+               gd.widthHint = 100;
+               butMTCallConnect.setLayoutData(gd);
+               butMTCallConnect.addSelectionListener( new SelectionAdapter(){
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               mtConnecct();
+                       }
+               });
+       }
+
+       private void createCallListInformationSection() {
+               Composite client = formUtil.createSection(parent, "Call List Information");
+               GridData gd = new GridData(SWT.FILL, SWT.FILL, false, true);
+               gd.widthHint = 580;
+               client.setLayoutData(gd);
+//             client.setData(new GridData(GridData.FILL, GridData.FILL, true, false));
+               String[] columnNames = {
+                               "Call Id", "Status", "Multiparty", "MO/MT", "Number"    
+               };
+               
+               viewer = formUtil.createTableViewer(client, columnNames);
+               gd = new GridData(SWT.NONE, SWT.NONE, false, true);
+               gd.widthHint = 560;
+               gd.heightHint = 76;
+               viewer.getControl().setLayoutData(gd);
+               viewer.setCellEditors(new CellEditor[]{
+                       null, 
+                       new ComboBoxCellEditor(viewer.getTable(), STATUS),
+                       new ComboBoxCellEditor(viewer.getTable(), MULTIPARTY),
+                       new ComboBoxCellEditor(viewer.getTable(), MO_MT),
+                       null
+               });
+               viewer.setContentProvider(new TableViewContentProvider());
+               viewer.setLabelProvider(new TableViewLabelProvider(viewer));
+               viewer.setInput(model);
+               viewer.addSelectionChangedListener(new ISelectionChangedListener () {
+
+                       @Override
+                       public void selectionChanged(SelectionChangedEvent event) {
+                               IStructuredSelection selection = (IStructuredSelection)viewer.getSelection();
+                               if(selection.isEmpty()) {
+                                       cmbCallListInformationCallStatus.setEnabled(false);
+                                       butCallListInformationCallEnd.setEnabled(false);
+                               } else {
+                                       cmbCallListInformationCallStatus.setEnabled(true);
+                                       butCallListInformationCallEnd.setEnabled(true);
+                               }
+                       }
+               });
+               
+               Composite subComposite = formUtil.createComposite(client, 2);
+               gd = new GridData(SWT.FILL, SWT.FILL, false, true);
+               gd.widthHint = 580;
+               subComposite.setLayoutData(gd);
+               cmbCallListInformationCallStatus = formUtil.createCombo(subComposite);
+               formUtil.setWidth(cmbCallListInformationCallStatus, 390);
+               formUtil.addComboItem(cmbCallListInformationCallStatus, ERROR_CODE_LIST.getErrorList(), defaultErrorCode);
+               cmbCallListInformationCallStatus.setEnabled(false);
+               butCallListInformationCallEnd = formUtil.createButton(subComposite, "Disconnect", SWT.PUSH);
+               gd = new GridData(SWT.FILL, SWT.FILL, false, false);
+               gd.widthHint = 100;
+               butCallListInformationCallEnd.setLayoutData(gd);
+               butCallListInformationCallEnd.addSelectionListener( new SelectionAdapter(){
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               callEnd(false);
+                       }
+               });
+               butCallListInformationCallEnd.setEnabled(false);
+       }
+       
+       public void callEnd(boolean isAllSelection){
+               //if(emulChange == true || isAllSelection)
+               if(isAllSelection)
+                       viewer.getTable().setSelection(0, 5);
+               
+               IStructuredSelection selection = (IStructuredSelection)viewer.getSelection();
+               if (selection.isEmpty())
+                       return;
+               
+               Object [] objs = selection.toArray();
+               for (int i = 0; i < objs.length; i++) {
+                       int errorCode = ERROR_CODE_LIST.getKey(cmbCallListInformationCallStatus.getText());
+                       int errorCause0 = errorCode & 0x00ff;
+                       int errorCause1 = (errorCode>>8) & 0x00ff;
+                       int callId = ((CallListVO)objs[i]).getCallId();
+                       
+                       G01A07 ga1 = new G01A07();
+                       ga1.intialize();
+                       
+                       StructureGA sga1 = ga1.getBody();
+                       sga1.setInt("ERROR_CAUSE_0", errorCause0);
+                       sga1.setInt("ERROR_CAUSE_1", errorCause1);
+                       
+                       G01A22End ga2 = new G01A22End();
+                       ga2.intialize();
+                       
+                       StructureGA sga2 = ga2.getBody();
+                       sga2.setInt("CALL_ID", callId);
+                       
+                       try {
+                               injectorSocket.send(ga1);
+                               injectorSocket.send(ga2);
+                               
+                               String mocallID = lblMOCallCallId.getText();
+                               if(mocallID == "")
+                                       continue;
+                               if(callId == Integer.parseInt(mocallID)) {
+                                       cmbMOCallCallStatus.setEnabled(false);
+                                       butMTCallConnect.setEnabled(true);
+                                       
+                                       butMOCall.setEnabled(false);
+                                       dialing = false;
+                                       MOCallevent = 0;
+                                       
+                                       lblMOCallCallId.setText("");
+                                       lblMOCallNumber.setText("");
+                                       lblMOCallCallType.setText("");
+                               }
+                       } catch (IOException e) {
+                               e.printStackTrace();
+                               cmbMOCallCallStatus.setEnabled(false);
+                               butMTCallConnect.setEnabled(true);
+                               
+                               butMOCall.setEnabled(false);
+                               dialing = false;
+                               MOCallevent = 0;
+                               
+                               lblMOCallCallId.setText("");
+                               lblMOCallNumber.setText("");
+                               lblMOCallCallType.setText("");
+                       } catch (Exception e) {
+                               e.printStackTrace();
+                               cmbMOCallCallStatus.setEnabled(false);
+                               butMTCallConnect.setEnabled(true);
+                               
+                               butMOCall.setEnabled(false);
+                               dialing = false;
+                               MOCallevent = 0;
+                               
+                               lblMOCallCallId.setText("");
+                               lblMOCallNumber.setText("");
+                               lblMOCallCallType.setText("");
+                       }
+               }
+       }
+       
+       private void moDisconnect() {
+               int errorCode = ERROR_CODE_LIST.getKey(cmbMOCallCallStatus.getText());
+               int errorCause0 = errorCode & 0x00ff;
+               int errorCause1 = (errorCode>>8) & 0x00ff;
+               String callId = lblMOCallCallId.getText();
+               
+               G01A07 ga1 = new G01A07();
+               ga1.intialize();
+
+               StructureGA sga1 = ga1.getBody();
+               sga1.setInt("ERROR_CAUSE_0", errorCause0);
+               sga1.setInt("ERROR_CAUSE_1", errorCause1);
+               
+               G01A22End ga2 = new G01A22End();
+               ga2.intialize();
+               
+               StructureGA sga2 = ga2.getBody();
+               sga2.setInt("CALL_ID", Integer.parseInt(callId));
+               
+               try {
+                       injectorSocket.send(ga1);
+                       injectorSocket.send(ga2);
+                       
+                       cmbMOCallCallStatus.setEnabled(false);
+                       butMTCallConnect.setEnabled(true);
+                       
+                       butMOCall.setEnabled(false);
+                       dialing = false;
+                       MOCallevent = 0;
+                       
+                       lblMOCallCallId.setText("");
+                       lblMOCallNumber.setText("");
+                       lblMOCallCallType.setText("");
+               } catch (IOException e) {
+                       e.printStackTrace();
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+       
+       private void moAlert() {
+               G01A62 ga = new G01A62();
+               ga.intialize();
+               
+               try {
+                       injectorSocket.send(ga);
+                       
+                       butMTCallConnect.setEnabled(true);
+                       butMOCall.setText("Connect");
+                       MOCallevent = 1;
+               } catch (IOException e) {
+                       e.printStackTrace();
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+       
+       private void moConnect() {
+               G01A23 ga = new G01A23();
+               ga.intialize();
+               
+               try {
+                       injectorSocket.send(ga);
+                       
+                       dialing = false;
+                       butMOCall.setText("Disconnect");
+                       MOCallevent = 2;
+               } catch (IOException e) {
+                       dialing = true;
+                       e.printStackTrace();
+               } catch (Exception e) {
+                       dialing = true;
+                       e.printStackTrace();
+               }
+       }
+
+       public static boolean checkNumberFormat(String noStr) {
+               Pattern tellPattern = Pattern.compile( "[^0-9++]");
+               Matcher matcher = tellPattern.matcher(noStr);
+               return matcher.find();
+       }
+       
+       public void showDialog(String msg)
+       {
+               Shell shell = parent.getShell();
+               InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, msg);
+               connectBtStatus(true);
+       }
+       
+       public void connectBtStatus(boolean status)
+       {
+               butMTCallConnect.setEnabled(status);
+               isbtenabled = status;
+       }
+       
+       private void mtConnecct() {
+               connectBtStatus(false);
+               
+               if(!rssiStatus)
+               {
+                       showDialog("RSSI level is zero.\nPlease try again later.");
+                       return;
+               }
+               
+               if(listfull == true)
+                {
+                       Shell shell = parent.getShell();
+                        InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "There are many pending connections.\nCan't connect anymore.");
+                }
+
+               if(incomming == true || dialing == true)
+               {
+                       showDialog("User is busy.\nPlease try again later.");
+                       return;
+               }
+               
+               if(TelephonySocket.getInstance().callWaiting == false && calling == true)
+               {
+                       showDialog("User is busy.\nCall waiting mode of emulator is off.\nPlease try again later.");
+                       return;
+               }
+
+               String number = txtMTCallNumber.getText().trim();
+               if(number==null||number.length()==0)
+               {
+                       butMTCallConnect.setEnabled(true);
+                       return;
+               }
+               
+               if(number.length() > 82)
+               {
+                       showDialog("The maximum length of phone number is 82.");
+                       return;
+               }
+               
+               if(checkNumberFormat(number))
+               {       
+                       showDialog("Wrong phone number.");
+                       return;
+               }
+               
+               int voice = 0x01;//butMTCallVoice.getSelection()?0x01:0x02;
+//             int forwardedCal = butMTCallForwardedCall.getSelection()?0x33:0x00;
+               int forwardedCal = 0;
+               int hidden = butMTCallHidden.getSelection()?0x01:0x00;
+               int numType=0x01;
+               int cliPresendInd = 0x01;//cmbMTCallCliPresendInd.getSelectionIndex()+1;
+               int noCliCause = 0x00;//cmbMTCallNoCliCause.getSelectionIndex();
+               
+               G01A21MT ga = new G01A21MT();
+               ga.intialize();
+               
+               StructureGA sga = ga.getBody();
+               sga.setInt("CALL_TYPE", voice);
+               sga.setInt("FORWARDED_STATUS", forwardedCal);
+               sga.setInt("CLIR_STATUS",hidden);
+               sga.setInt("NUM_LEN",number.getBytes().length);
+               sga.setInt("NUM_TYPE", numType);
+               sga.setInt("CLI_PRESENT_ID", cliPresendInd);
+               sga.setInt("NO_CLI_CAUSE", noCliCause);
+               sga.setByteArray("CALL_NUMBER", number.getBytes());
+               
+               try {
+                       injectorSocket.send(ga);
+               } catch (IOException e) {
+                       e.printStackTrace();
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+               
+               try {
+                       new ProgressMonitorDialog(parent.getShell()).run(true, false,
+                                       new IRunnableWithProgress() {
+                                               public void run(IProgressMonitor monitor)
+                                                               throws InvocationTargetException,
+                                                               InterruptedException {
+                                                       while(true)
+                                                       {                       
+                                                               if(isbtenabled)
+                                                                       break;
+                                                               
+                                                               Thread.sleep(100);      // 1/10 sec
+                                                       }
+                                       }
+                       });
+               } catch (InterruptedException e) {
+                       e.printStackTrace();
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+       
+       public class CallList22Receiver extends AbstractInjectorReceiver{ //끊었을 때
+               public void run(AbstractGA aga) {
+                       model.clear();
+                       StructureGA header = aga.getHeader();
+                       int loopCount = header.getInt("COUNT");
+                       int addCnt = 0;
+                       boolean chmodisc = false;
+
+                       connectBtStatus(true);
+                       StructureGA body = aga.getBody();
+                       incomming = false;
+                       for(int i=0; i < loopCount; i++){
+                               CallListVO cl = new CallListVO();
+                               cl.setCallId(body.getInt("IDX",i));
+                               cl.setStatus(body.getInt("STAT",i)-1);
+                               cl.setMultiParty(body.getInt("MULTIPARTY",i));
+                               cl.setMomt(body.getInt("DIR",i) - 1);
+                               cl.setNumber(new String(body.getByteArray("NUMBER",i)).trim());                         
+                               if(cl.getStatus() == -1)
+                               {
+                                       loopCount++;
+                                       addCnt++;
+                                       continue;
+                               }
+                               else if(cl.getStatus() == 4 || cl.getStatus() == 5)
+                                       incomming = true;
+                               
+                               String tmp1 = cl.getNumber();
+                               String tmp2 = lblMOCallNumber.getText();
+                               if(tmp1.compareTo(tmp2) == 0)
+                                       chmodisc = true;
+                               
+                               model.add(cl);
+                       }
+                       loopCount -= addCnt;
+                       ((TelephonyCall)getParent()).refresh();
+                       if(loopCount != 6)
+                               listfull = false;
+                       
+                       if(loopCount == 0)
+                               calling = false;
+
+                       if(chmodisc == false)
+                       {
+                               cmbMOCallCallStatus.setEnabled(false);
+                               butMTCallConnect.setEnabled(true);
+                               
+                               butMOCall.setEnabled(false);
+                               dialing = false;
+                               MOCallevent = 0;
+                               
+                               lblMOCallCallId.setText("");
+                               lblMOCallNumber.setText("");
+                               lblMOCallCallType.setText("");
+                       }
+               }
+               @Override
+               public AbstractGA createTransferObject() {
+                       return new G01A22();
+               }
+       }
+       
+       public class CallList26Receiver extends AbstractInjectorReceiver{ //받았을 때
+               @Override
+               public void run(AbstractGA aga) {
+                       model.clear();
+                       StructureGA header = aga.getHeader();
+                       int loopCount = header.getInt("COUNT");
+                       incomming = false;
+                       
+                       connectBtStatus(true);
+                       StructureGA body = aga.getBody();
+                       for(int i=0; i < loopCount; i++){
+                               CallListVO cl = new CallListVO();
+                               cl.setCallId(body.getInt("IDX",i));
+                               cl.setStatus(body.getInt("STAT",i)-1);
+                               cl.setMultiParty(body.getInt("MULTIPARTY",i));
+                               cl.setMomt(body.getInt("DIR",i) - 1);
+                               cl.setNumber(new String(body.getByteArray("NUMBER",i)).trim());
+                               
+                               if(cl.getStatus() == AT_CALL_STAT_ERR)
+                               {
+                                       loopCount++;
+                                       continue;
+                               }
+                               else if(cl.getStatus() == AT_CALL_STAT_INCOMING || cl.getStatus() == AT_CALL_STAT_WAITING)
+                                       incomming = true;
+                               
+                               model.add(cl);
+                               calling = true;
+                       }
+                       ((TelephonyCall)getParent()).refresh();
+               }
+               @Override
+               public AbstractGA createTransferObject() {
+                       return new G01A26();
+               }
+       }
+       
+       public class CallList29Receiver extends AbstractInjectorReceiver{//걸릴때
+               @Override
+               public void run(AbstractGA aga) {
+                       model.clear();
+                       StructureGA header = aga.getHeader();
+                       int loopCount = header.getInt("COUNT");
+                       int addCnt = 0;
+                       incomming = false;
+                       
+                       connectBtStatus(true);
+                       StructureGA body = aga.getBody();
+                       for(int i=0; i < loopCount; i++){
+                               CallListVO cl = new CallListVO();
+                               cl.setCallId(body.getInt("IDX",i));
+                               cl.setStatus(body.getInt("STAT",i)-1);
+                               cl.setMultiParty(body.getInt("MULTIPARTY",i));
+                               cl.setMomt(body.getInt("DIR",i) - 1);
+                               cl.setNumber(new String(body.getByteArray("NUMBER",i)).trim());
+                               if(cl.getStatus() == -1)
+                               {
+                                       loopCount++;
+                                       addCnt++;
+                                       continue;
+                               }
+                               else if(cl.getStatus() == 4 || cl.getStatus() == 5)
+                                       incomming = true;
+
+                               model.add(cl);
+                               calling = true;
+                       }
+                       loopCount -= addCnt;
+                       ((TelephonyCall)getParent()).refresh();
+/*                     if(emulChange == true)
+                       {
+                               callEnd(false);
+                               calling = false;
+                               emulChange = false;
+                       }
+*/                     
+                       if(loopCount == 6)
+                               listfull = true;
+                       else
+                               listfull = false;
+               }
+               @Override
+               public AbstractGA createTransferObject() {
+                       return new G01A29();
+               }
+       }
+       
+       public class CallReceiver extends AbstractInjectorReceiver{
+               @Override
+               public void run(AbstractGA aga) {
+                       StructureGA sga = aga.getBody();
+                       int callId = sga.getInt("CALL_ID");
+                       int callType = sga.getInt("CALL_TYPE");
+                       String callNumber = new String(sga.getByteArray("CALL_NUMBER")).trim();
+                       
+                       lblMOCallCallId.setText(new Integer(callId).toString());
+                       lblMOCallNumber.setText(callNumber);
+                       lblMOCallCallType.setText(CALL_TYPE_LIST[callType]);
+                       
+                       butMOCall.setEnabled(true);
+                       byte[] callStatus = sga.getByteArray("CALL_NUMBER");
+                       if(callStatus[0] == 0x04)       // 0x04 is alert
+                       {
+                               dialing = true;
+                               
+                               butMOCall.setText("Connect");
+                               MOCallevent = 1;
+                       }
+                       else    // 0x03 is dialling
+                       {
+                               dialing = true;
+                               
+                               butMOCall.setText("Alert");
+                               MOCallevent = 0;
+                       }
+                       
+                       cmbMOCallCallStatus.setEnabled(true);
+                       
+                       butMTCallConnect.setEnabled(false);
+               }
+               
+               @Override
+               public AbstractGA createTransferObject() {
+                       return new G01A21MO();
+               }
+       }
+
+       @Override
+       public void selectionChanged(FileEntry selectedEntry) {
+               if( selectedEntry == null) {
+                       return;
+               }
+
+               if(currentDevice != null)
+               {
+                       if (currentDevice.getSerialNumber() != selectedEntry.getDevice().getSerialNumber()) {
+                               try {
+                                       viewer.getTable().removeAll();
+                                       cmbMOCallCallStatus.setEnabled(false);
+                                       butMTCallConnect.setEnabled(true);
+                                       
+                                       butMOCall.setEnabled(false);
+                                       dialing = false;
+                                       MOCallevent = 0;
+                                       
+                                       lblMOCallCallId.setText("");
+                                       lblMOCallNumber.setText("");
+                                       lblMOCallCallType.setText("");
+                                       TelephonySocket.getInstance().sendAskData();
+                               } catch (IOException e) {
+                                       e.printStackTrace();
+                               } catch (Exception e) {
+                                       // TODO Auto-generated catch block
+                                       e.printStackTrace();
+                               }
+                       }
+               }
+               currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
+       }
+}
+
diff --git a/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/page/RemoteParty.java b/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/page/RemoteParty.java
new file mode 100644 (file)
index 0000000..ac4e02c
--- /dev/null
@@ -0,0 +1,295 @@
+/*
+ * org.tizen.injector.telephony.call
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.call.page;
+
+import java.io.IOException;
+
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ComboBoxCellEditor;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+
+import org.tizen.injector.control.TableViewContentProvider;
+import org.tizen.injector.control.TableViewLabelProvider;
+import org.tizen.injector.model.DefaultTableModel;
+import org.tizen.injector.protocol.AbstractGA;
+import org.tizen.injector.protocol.StructureGA;
+import org.tizen.injector.provider.AbstractInjectorItem;
+import org.tizen.injector.provider.AbstractInjectorPage;
+import org.tizen.injector.telephony.call.TelephonyCall;
+import org.tizen.injector.telephony.call.protocol.G01A07;
+import org.tizen.injector.telephony.call.protocol.G01A22End;
+import org.tizen.injector.telephony.call.protocol.G03A58;
+import org.tizen.injector.telephony.call.protocol.G03A59;
+import org.tizen.injector.telephony.call.protocol.G0DA09;
+import org.tizen.injector.telephony.call.protocol.G0DA0B;
+import org.tizen.injector.telephony.call.resource.ErrorCode;
+
+public class RemoteParty  extends AbstractInjectorPage{
+       
+       public RemoteParty(AbstractInjectorItem item, String name, DefaultTableModel model) {
+               super(item, name);
+               this.model = model;
+       }
+
+       private final String[] CALL_PROCESS_LIST = {
+                       "Hold/Retrieve", "Join", "Split"
+       };
+       
+       private String defaultErrorCode = "No-Errors";
+       private ErrorCode ERROR_CODE_LIST = new ErrorCode();
+
+       private final String[] STATUS = { "ACTIVE", "HELD", "DIALING", "ALERT",
+                       "INCOMING", "WAITING", "MAX" };
+       private final String[] MO_MT = { "MO", "MT", "MAX" };
+       private final String[] MULTIPARTY = { "FALSE", "TRUE" };
+       
+       private Text txtCallListInformationCallId;
+       private Combo cmbCallListInformationCallStatus;
+       private Button butCallListInformationCallEnd;
+       
+       private Button butRemotePartyHold, butRemotePartyActive, butRemotePartySet;
+       private Combo cmbRemotePartyCallProcess, cmbRemotePartyCallStatus;
+       
+       private TableViewer viewer;
+       private DefaultTableModel model;
+       
+       protected void createContents() {
+               createCallListInformationSection();
+               createRemoteParty();
+               ((TelephonyCall)getParent()).addViewer(viewer);
+       }
+
+       protected void registerReceivers() {
+       }
+       
+       private void createCallListInformationSection() {
+               Composite client = formUtil.createSection(parent, "Call List Information");
+
+               Composite mainComposite = formUtil.createComposite(client);
+               String[] columnNames = { "Call Id", "Status", "Multiparty", "MO/MT",
+                               "Number" };
+               viewer = formUtil.createTableViewer(mainComposite, columnNames);
+               viewer.setCellEditors(new CellEditor[]{
+                       null, 
+                       new ComboBoxCellEditor(viewer.getTable(), STATUS),
+                       new ComboBoxCellEditor(viewer.getTable(), MULTIPARTY),
+                       new ComboBoxCellEditor(viewer.getTable(), MO_MT),
+                       null
+               });
+               viewer.setContentProvider(new TableViewContentProvider());
+               viewer.setLabelProvider(new TableViewLabelProvider(viewer));
+               viewer.setInput(model);
+               
+               Composite buttonComposite = formUtil.createComposite(mainComposite,4);
+               formUtil.createLabel(buttonComposite, "Call Id : ");
+               txtCallListInformationCallId = formUtil.createText(buttonComposite, "");
+               txtCallListInformationCallId.setTextLimit(1);
+               cmbCallListInformationCallStatus = formUtil.createCombo(buttonComposite);
+               formUtil.addComboItem(cmbCallListInformationCallStatus, ERROR_CODE_LIST.getErrorList(), defaultErrorCode);
+               butCallListInformationCallEnd = formUtil.createButton(buttonComposite, "Call End",SWT.PUSH);
+               butCallListInformationCallEnd.addSelectionListener( new SelectionAdapter(){
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               callEnd();
+                       }
+               });
+       
+       }
+       
+       private void createRemoteParty() {
+               Composite client = formUtil.createSection(parent, "Remote Party");
+               
+               Composite mainComposite = formUtil.createComposite(client);
+               formUtil.createLabel(mainComposite, "Notify Indication");
+               Composite buttonComposite = formUtil.createComposite(mainComposite,2);
+               butRemotePartyHold = formUtil.createButton(buttonComposite, "Hold",SWT.PUSH);
+               butRemotePartyHold.addSelectionListener( new SelectionAdapter(){
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               hold();
+                       }
+               });
+               butRemotePartyActive = formUtil.createButton(buttonComposite, "Active",SWT.PUSH);
+               butRemotePartyActive.addSelectionListener( new SelectionAdapter(){
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               active();
+                       }
+               });
+               
+               formUtil.createLabel(mainComposite, "Set Response Error");
+               buttonComposite = formUtil.createComposite(mainComposite,3);
+               cmbRemotePartyCallProcess = formUtil.createCombo(buttonComposite);
+               formUtil.addComboItem(cmbRemotePartyCallProcess, CALL_PROCESS_LIST);
+               cmbRemotePartyCallStatus = formUtil.createCombo(buttonComposite);
+               formUtil.addComboItem(cmbRemotePartyCallStatus, ERROR_CODE_LIST.getErrorList(), defaultErrorCode);
+               butRemotePartySet = formUtil.createButton(buttonComposite, "Set",SWT.PUSH);
+               butRemotePartySet.addSelectionListener( new SelectionAdapter(){
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               int idx = cmbRemotePartyCallProcess.getSelectionIndex();
+                               if(idx==0)
+                                       holdRetrieve();
+                               else if(idx==1)
+                                       join();
+                               else if(idx==2)
+                                       split();
+                       }
+               });
+               
+       }
+       
+       private void callEnd(){
+               int errorCode = ERROR_CODE_LIST.getKey(cmbCallListInformationCallStatus.getText());
+               int errorCause0 = errorCode & 0x00ff;
+               int errorCause1 = (errorCode>>8) & 0x00ff;
+               String callId = txtCallListInformationCallId.getText();
+               
+               G01A07 ga1 = new G01A07();
+               ga1.intialize();
+               
+               StructureGA sga1 = ga1.getBody();
+               sga1.setInt("ERROR_CAUSE_0", errorCause0);
+               sga1.setInt("ERROR_CAUSE_1", errorCause1);
+               
+               G01A22End ga2 = new G01A22End();
+               ga2.intialize();
+               
+               StructureGA sga2 = ga2.getBody();
+               sga2.setInt("CALL_ID", Integer.parseInt(callId));
+               
+               
+               try {
+                       injectorSocket.send(ga1);
+                       injectorSocket.send(ga2);
+                       
+                       txtCallListInformationCallId.setText("");
+               } catch (IOException e) {
+                       e.printStackTrace();
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+               
+       private void hold() {
+               G03A58 ga = new G03A58();
+               ga.intialize();
+               
+               try {
+                       injectorSocket.send(ga);
+               } catch (IOException e) {
+                       e.printStackTrace();
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+       
+       private void active() {
+               G03A59 ga = new G03A59();
+               ga.intialize();
+               
+               try {
+                       injectorSocket.send(ga);
+               } catch (IOException e) {
+                       e.printStackTrace();
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+       
+       private void holdRetrieve() {
+               AbstractGA[] gas = createResponseErrorGA(new G0DA09());
+               
+               try {
+                       injectorSocket.send(gas[0]);
+                       injectorSocket.send(gas[1]);
+               } catch (IOException e) {
+                       e.printStackTrace();
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+       
+       private void join() {
+               AbstractGA[] gas = createResponseErrorGA(new G0DA0B());
+               
+               try {
+                       injectorSocket.send(gas[0]);
+                       injectorSocket.send(gas[1]);
+               } catch (IOException e) {
+                       e.printStackTrace();
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+       
+       private void split() {
+               AbstractGA[] gas = createResponseErrorGA(new G0DA09());
+               
+               try {
+                       injectorSocket.send(gas[0]);
+                       injectorSocket.send(gas[1]);
+               } catch (IOException e) {
+                       e.printStackTrace();
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+               
+       private AbstractGA[] createResponseErrorGA(AbstractGA ga2){
+               int errorCode = ERROR_CODE_LIST.getKey(cmbRemotePartyCallStatus.getText());
+               int errorCause0 = errorCode & 0x00ff;
+               int errorCause1 = (errorCode>>8) & 0x00ff;
+               
+               G01A07 ga1 = new G01A07();
+               ga1.intialize();
+               
+               StructureGA sga1 = ga1.getBody();
+               sga1.setInt("ERROR_CAUSE_0", errorCause0);
+               sga1.setInt("ERROR_CAUSE_1", errorCause1);
+               
+               ga2.intialize();
+               
+               StructureGA sga2 = ga2.getBody();
+               sga2.setInt("ERROR_CAUSE_0", errorCause0);
+               sga2.setInt("ERROR_CAUSE_1", errorCause1);
+               
+               AbstractGA[] gas = new AbstractGA[2];
+               gas[0] = ga1;
+               gas[1] = ga2;
+               
+               return gas;
+       }
+}
diff --git a/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G01A07.java b/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G01A07.java
new file mode 100644 (file)
index 0000000..0c32bc7
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * org.tizen.injector.telephony.call
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.call.protocol;
+
+import org.tizen.injector.protocol.AbstractGA;
+import org.tizen.injector.protocol.StructureGA;
+
+public class G01A07 extends AbstractGA{
+
+       public G01A07(){
+               super(0x01, 0x07);
+       }
+
+       @Override
+       protected void makeBody() {
+               StructureGA ga = getBody();
+               ga.addByteItem("ERROR_CAUSE_0");
+               ga.addByteItem("ERROR_CAUSE_1");
+       }
+
+       @Override
+       protected void makeHeader() {
+       }
+}
diff --git a/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G01A21MO.java b/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G01A21MO.java
new file mode 100644 (file)
index 0000000..a2f9b96
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * org.tizen.injector.telephony.call
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.call.protocol;
+
+import org.tizen.injector.protocol.AbstractGA;
+import org.tizen.injector.protocol.StructureGA;
+
+public class G01A21MO extends AbstractGA{
+
+       public G01A21MO(){
+               super(0x01, 0x21);
+       }
+
+       @Override
+       protected void makeBody() {
+               StructureGA ga = getBody();
+               ga.addByteItem("CALL_ID");
+               ga.addByteItem("CALL_TYPE");
+               ga.addByteItem("LEN");
+               ga.addByteArrayItem("CALL_NUMBER", 10);
+       }
+
+       @Override
+       protected void makeHeader() {
+               
+       }
+}
diff --git a/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G01A21MT.java b/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G01A21MT.java
new file mode 100644 (file)
index 0000000..aa1365a
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * org.tizen.injector.telephony.call
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.call.protocol;
+
+import org.tizen.injector.protocol.AbstractGA;
+import org.tizen.injector.protocol.StructureGA;
+
+public class G01A21MT extends AbstractGA{
+
+       public G01A21MT(){
+               super(0x01, 0x21);
+       }
+
+       @Override
+       protected void makeBody() {
+               StructureGA ga = getBody();
+               ga.addByteItem("CALL_TYPE");
+               ga.addByteItem("FORWARDED_STATUS");
+               ga.addByteItem("CLIR_STATUS");
+               ga.addByteItem("NUM_LEN");
+               ga.addByteItem("NUM_TYPE");
+               ga.addByteItem("CLI_PRESENT_ID");
+               ga.addByteItem("NO_CLI_CAUSE");
+               ga.addByteArrayItem("CALL_NUMBER", 45);
+       }
+
+       @Override
+       protected void makeHeader() {
+       }
+}
diff --git a/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G01A22.java b/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G01A22.java
new file mode 100644 (file)
index 0000000..ced2948
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * org.tizen.injector.telephony.call
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.call.protocol;
+
+import org.tizen.injector.protocol.AbstractGA;
+import org.tizen.injector.protocol.StructureGA;
+
+public class G01A22 extends AbstractGA{
+
+       public G01A22(){
+               super(0x01, 0x22);
+       }
+
+       @Override
+       protected void makeBody() {
+               StructureGA ga = getBody();
+               ga.addIntItem("IDX");
+               ga.addIntItem("DIR");
+               ga.addIntItem("STAT");
+               ga.addIntItem("CALL_TYPE");
+               ga.addByteItem("MULTIPARTY");
+               ga.addByteArrayItem("NUMBER", 32);
+               ga.addByteArrayItem("dummy", 3);
+               ga.addIntItem("TYPE");
+               ga.addIntItem("NUM_LEN");
+               ga.addIntItem("NUM_OF_TYPE");
+               ga.addByteArrayItem("ALPHA",32);
+       }
+
+       @Override
+       protected void makeHeader() {
+               StructureGA ga = getHeader();
+               ga.addIntItem("COUNT");
+       }
+}
diff --git a/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G01A22End.java b/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G01A22End.java
new file mode 100644 (file)
index 0000000..494cdf1
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * org.tizen.injector.telephony.call
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.call.protocol;
+
+import org.tizen.injector.protocol.AbstractGA;
+import org.tizen.injector.protocol.StructureGA;
+
+public class G01A22End extends AbstractGA{
+
+       public G01A22End(){
+               super(0x01, 0x22);
+       }
+
+       @Override
+       protected void makeBody() {
+               StructureGA ga = getBody();
+               ga.addByteItem("CALL_ID");
+       }
+
+       @Override
+       protected void makeHeader() {
+       }
+}
diff --git a/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G01A23.java b/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G01A23.java
new file mode 100644 (file)
index 0000000..eb229de
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * org.tizen.injector.telephony.call
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.call.protocol;
+
+import org.tizen.injector.protocol.AbstractGA;
+
+public class G01A23 extends AbstractGA{
+
+       public G01A23(){
+               super(0x01, 0x23);
+       }
+
+       @Override
+       protected void makeBody() {
+       }
+
+       @Override
+       protected void makeHeader() {
+       }
+}
diff --git a/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G01A26.java b/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G01A26.java
new file mode 100644 (file)
index 0000000..4801e0e
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * org.tizen.injector.telephony.call
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.call.protocol;
+
+import org.tizen.injector.protocol.AbstractGA;
+import org.tizen.injector.protocol.StructureGA;
+
+public class G01A26 extends AbstractGA{
+
+       public G01A26(){
+               super(0x01, 0x26);
+       }
+
+       @Override
+       protected void makeBody() {
+               StructureGA ga = getBody();
+               ga.addIntItem("IDX");
+               ga.addIntItem("DIR");
+               ga.addIntItem("STAT");
+               ga.addIntItem("CALL_TYPE");
+               ga.addByteItem("MULTIPARTY");
+               ga.addByteArrayItem("NUMBER", 32);
+               ga.addByteArrayItem("dummy", 3);
+               ga.addIntItem("TYPE");
+               ga.addIntItem("NUM_LEN");
+               ga.addIntItem("NUM_OF_TYPE");
+               ga.addByteArrayItem("ALPHA",32);
+       }
+
+       @Override
+       protected void makeHeader() {
+               StructureGA ga = getHeader();
+               ga.addIntItem("COUNT");
+       }
+}
diff --git a/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G01A29.java b/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G01A29.java
new file mode 100644 (file)
index 0000000..e051a69
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * org.tizen.injector.telephony.call
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.call.protocol;
+
+import org.tizen.injector.protocol.AbstractGA;
+import org.tizen.injector.protocol.StructureGA;
+
+public class G01A29 extends AbstractGA{
+
+       public G01A29(){
+               super(0x01, 0x29);
+       }
+
+       @Override
+       protected void makeBody() {
+               StructureGA ga = getBody();
+               ga.addIntItem("IDX");
+               ga.addIntItem("DIR");
+               ga.addIntItem("STAT");
+               ga.addIntItem("CALL_TYPE");
+               ga.addByteItem("MULTIPARTY");
+               ga.addByteArrayItem("NUMBER", 32);
+               ga.addByteArrayItem("dummy", 3);
+               ga.addIntItem("TYPE");
+               ga.addIntItem("NUM_LEN");
+               ga.addIntItem("NUM_OF_TYPE");
+               ga.addByteArrayItem("ALPHA",32);
+       }
+
+       @Override
+       protected void makeHeader() {
+               StructureGA ga = getHeader();
+               ga.addIntItem("COUNT");
+       }
+       
+}
diff --git a/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G01A62.java b/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G01A62.java
new file mode 100644 (file)
index 0000000..a9af19d
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * org.tizen.injector.telephony.call
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.call.protocol;
+
+import org.tizen.injector.protocol.AbstractGA;
+
+public class G01A62 extends AbstractGA{
+
+       public G01A62(){
+               super(0x01, 0x62);
+       }
+
+       @Override
+       protected void makeBody() {
+       }
+
+       @Override
+       protected void makeHeader() {
+       }
+}
diff --git a/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G03A58.java b/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G03A58.java
new file mode 100644 (file)
index 0000000..dbf3149
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * org.tizen.injector.telephony.call
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.call.protocol;
+
+import org.tizen.injector.protocol.AbstractGA;
+
+public class G03A58 extends AbstractGA{
+
+       public G03A58(){
+               super(0x03, 0x58);
+       }
+
+       @Override
+       protected void makeBody() {
+       }
+
+       @Override
+       protected void makeHeader() {
+       }
+}
diff --git a/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G03A59.java b/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G03A59.java
new file mode 100644 (file)
index 0000000..5f3d33e
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * org.tizen.injector.telephony.call
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.call.protocol;
+
+import org.tizen.injector.protocol.AbstractGA;
+
+public class G03A59 extends AbstractGA{
+
+       public G03A59(){
+               super(0x03, 0x59);
+       }
+
+       @Override
+       protected void makeBody() {
+       }
+
+       @Override
+       protected void makeHeader() {
+       }
+}
diff --git a/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G0DA09.java b/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G0DA09.java
new file mode 100644 (file)
index 0000000..fac3a18
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * org.tizen.injector.telephony.call
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.call.protocol;
+
+import org.tizen.injector.protocol.AbstractGA;
+import org.tizen.injector.protocol.StructureGA;
+
+public class G0DA09 extends AbstractGA{
+
+       public G0DA09(){
+               super(0x0d, 0x09);
+       }
+
+       @Override
+       protected void makeBody() {
+               StructureGA ga = getBody();
+               ga.addByteItem("ERROR_CAUSE_0");
+               ga.addByteItem("ERROR_CAUSE_1");
+       }
+
+       @Override
+       protected void makeHeader() {
+       }
+}
diff --git a/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G0DA0B.java b/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/protocol/G0DA0B.java
new file mode 100644 (file)
index 0000000..fc2f696
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * org.tizen.injector.telephony.call
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.call.protocol;
+
+import org.tizen.injector.protocol.AbstractGA;
+import org.tizen.injector.protocol.StructureGA;
+
+public class G0DA0B extends AbstractGA{
+
+       public G0DA0B(){
+               super(0x0d, 0x0b);
+       }
+
+       @Override
+       protected void makeBody() {
+               StructureGA ga = getBody();
+               ga.addByteItem("ERROR_CAUSE_0");
+               ga.addByteItem("ERROR_CAUSE_1");
+       }
+
+       @Override
+       protected void makeHeader() {
+       }
+}
diff --git a/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/resource/ErrorCode.java b/org.tizen.injector.telephony.call/src/org/tizen/injector/telephony/call/resource/ErrorCode.java
new file mode 100644 (file)
index 0000000..95e1e0b
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ * org.tizen.injector.telephony.call
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.call.resource;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+public class ErrorCode {
+       private HashMap<String,Integer> map;
+       private ArrayList<String> list;
+       public ErrorCode(){
+               map = new HashMap<String,Integer>();
+               list = new ArrayList<String>();
+               
+//             add(30,"no network service");
+//             add(0,"Phone failure");
+//             add(1,"CALL Not Available");
+//             add(2,"Phone-adapter link reserved");
+//             add(3,"Operation not allowed");
+//             add(4,"Operation not supported");
+//             add(5,"PH-SIM PIN required");
+//             add(6,"PH-FSIM PIN required");
+//             add(7,"PH-FSIM PUK required");
+//             add(10,"SIM not inserted(Note)");
+//             add(11,"SIM PIN required");
+//             add(12,"SIM PUK required");
+//             add(13,"SIM failure(Note)");
+//             add(14,"SIM busy(Note)");
+//             add(15,"SIM wrong(Note)");
+//             add(16,"Incorrect password");
+//             add(17,"SIM PIN2 required");
+//             add(18,"SIM PUK2 required");
+//             add(20,"Memory full");
+//             add(21,"Invalid Index");
+//             add(22,"Not found");
+//             add(23,"Memory failure");
+//             add(24,"text string too long");
+//             add(25,"Invalid characters in text string");
+//             add(26,"dial string too long");
+//             add(27,"invalid characters in dial string");
+               add(32768,"CALL OK(Success)");
+//             add(31,"network timeout");
+//             add(32,"network not allowed-emergency calls only");
+//             add(40,"network personalization PIN required");
+//             add(41,"network personalization PUK required");
+//             add(42,"network subset personalization PIN required");
+//             add(43,"network subset personalization PUK required");
+//             add(44,"service provider personalization PIN required");
+//             add(45,"service provider personalization PUK required");
+//             add(46,"corporated personalization PIN required");
+//             add(47,"corporated personalization PUK required");
+//             add(48,"hidden key required");
+//             add(100,"unknown");
+//             add(32769,"invalid IPC format or parameters");
+//             add(32770,"Phone is in the Offline state");
+//             add(32771,"IPC command not allowed");
+//             add(32772,"Phone is in the conversation state");
+//             add(32773,"Invalid state");
+//             add(32774,"No Internal free buffers");
+//             add(32775,"Operation Rejected");
+//             add(32776,"Insufficient resource");
+//             add(32777,"Network not Respond");
+//             add(32778,"SIM Pin enable required");
+//             add(32779,"SIM permanent blocked");
+//             add(32780,"SIM Phonebook Restricted");
+//             add(32781,"Dialing restricted by FDN mode");
+//             add(33041,"SS_Error Status");
+//             add(33062,"Negative Password Check");
+//             add(33068,"numberOfPW _AttemptsViolation - Password");
+       }
+       
+       private void add(int key, String str){
+               map.put(str, key);
+               list.add(str);
+       }
+       
+       public String[] getErrorList(){
+               return list.toArray(new String[size()]);
+       }
+
+       public int size(){
+               return list.size();
+       }
+       
+       public int getKey(String str){
+               return map.get(str);
+       }
+}
diff --git a/org.tizen.injector.telephony.sms/.classpath b/org.tizen.injector.telephony.sms/.classpath
new file mode 100644 (file)
index 0000000..ad32c83
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+       <classpathentry kind="src" path="src"/>
+       <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.tizen.injector.telephony.sms/.project b/org.tizen.injector.telephony.sms/.project
new file mode 100644 (file)
index 0000000..edd1c01
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.tizen.injector.telephony.sms</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+       </natures>
+</projectDescription>
diff --git a/org.tizen.injector.telephony.sms/.settings/org.eclipse.core.resources.prefs b/org.tizen.injector.telephony.sms/.settings/org.eclipse.core.resources.prefs
new file mode 100644 (file)
index 0000000..540d0ab
--- /dev/null
@@ -0,0 +1,3 @@
+#Wed Dec 01 09:09:30 CET 2010
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/org.tizen.injector.telephony.sms/.settings/org.eclipse.core.runtime.prefs b/org.tizen.injector.telephony.sms/.settings/org.eclipse.core.runtime.prefs
new file mode 100644 (file)
index 0000000..324e13f
--- /dev/null
@@ -0,0 +1,3 @@
+#Tue Dec 14 16:32:05 CET 2010
+eclipse.preferences.version=1
+line.separator=\n
diff --git a/org.tizen.injector.telephony.sms/META-INF/MANIFEST.MF b/org.tizen.injector.telephony.sms/META-INF/MANIFEST.MF
new file mode 100644 (file)
index 0000000..6b46217
--- /dev/null
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Tizen Event Injector Telephony Sms
+Bundle-SymbolicName: org.tizen.injector.telephony.sms;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: The Linux Foundation
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.tizen.common,
+ org.eclipse.ui.forms;bundle-version="3.3.103",
+ org.tizen.injector,
+ org.tizen.common.connection,
+ org.tizen.injector.telephony.call
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Import-Package: org.tizen.injector.telephony.call,
+ org.tizen.sdblib,
+ org.tizen.sdblib.service
diff --git a/org.tizen.injector.telephony.sms/OSGI-INF/l10n/bundle.properties b/org.tizen.injector.telephony.sms/OSGI-INF/l10n/bundle.properties
new file mode 100644 (file)
index 0000000..673029c
--- /dev/null
@@ -0,0 +1,4 @@
+#Properties file for org.tizen.injector.telephony.sms
+Bundle-Vendor = Tizen
+Bundle-Name = Tizen SDK Telephony SMS
+Telephony_SMS = Telephony Messaging
\ No newline at end of file
diff --git a/org.tizen.injector.telephony.sms/build.properties b/org.tizen.injector.telephony.sms/build.properties
new file mode 100644 (file)
index 0000000..439377d
--- /dev/null
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+               META-INF/,\
+               .,\
+               OSGI-INF/l10n/bundle.properties
+javacSource = 1.6
+javacTarget = 1.6
diff --git a/org.tizen.injector.telephony.sms/icons/telephony_view.png b/org.tizen.injector.telephony.sms/icons/telephony_view.png
new file mode 100644 (file)
index 0000000..d87e1cb
Binary files /dev/null and b/org.tizen.injector.telephony.sms/icons/telephony_view.png differ
diff --git a/org.tizen.injector.telephony.sms/plugin.xml b/org.tizen.injector.telephony.sms/plugin.xml
new file mode 100644 (file)
index 0000000..10a644c
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+       <extension
+         point="org.tizen.injector.injectorItemProvider">
+      <itemType
+               category="Telephony"
+            class="org.tizen.injector.telephony.sms.TelephonySMS"
+            id="org.tizen.injector.telephony.sms.TelephonySMS"
+            name="%Telephony_SMS">
+      </itemType>
+   </extension>        
+</plugin>
diff --git a/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/Messages.java b/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/Messages.java
new file mode 100644 (file)
index 0000000..619f87e
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * org.tizen.injector.telephony.sms
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.sms;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+       private static final String BUNDLE_NAME = "org.tizen.injector.telephony.sms.messages"; //$NON-NLS-1$
+       public static String TelephonySMS_0;
+       static {
+               // initialize resource bundle
+               NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+       }
+
+       private Messages() {
+       }
+}
diff --git a/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/TelephonySMS.java b/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/TelephonySMS.java
new file mode 100644 (file)
index 0000000..d6e1606
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * org.tizen.injector.telephony.sms
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.sms;
+
+//import org.tizen.injector.telephony.sms.page.CellBroadcasting;
+import org.tizen.injector.provider.AbstractInjectorItem;
+import org.tizen.injector.telephony.sms.page.SMS;
+
+public class TelephonySMS  extends AbstractInjectorItem {
+
+       @Override
+       protected void addPages() {
+                       addPage(new SMS(this, Messages.TelephonySMS_0));
+//                     addPage(new CellBroadcasting(this,"Cell Broadcasting"));
+       }
+}
diff --git a/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/DecodeMsg.java b/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/DecodeMsg.java
new file mode 100644 (file)
index 0000000..16ae825
--- /dev/null
@@ -0,0 +1,657 @@
+/*
+ * org.tizen.injector.telephony.sms
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.sms.encription;
+
+import java.io.UnsupportedEncodingException;
+import java.util.HashSet;
+
+public class DecodeMsg {
+       int ton, npi;
+       public static boolean deliveryReport = false;
+       public static char[] smsbuffer = new char[4096];
+       public static int smsbuffer_index = 0;
+       public static boolean relayedsms = false;
+       public static int relay_cnt = 0;
+       public static int udhl = 0;
+       public static HashSet<String> deliveryReportNum_set = new HashSet<String>();
+       public static boolean isDecodeEnd = true;
+       
+       public void DecodeSmsSubmitTpdu(TPDU_SMS_SUBMIT tpdu_submit, int pdu_len, char[] pPDU) {
+               isDecodeEnd = false;
+               int scaAddr_len = 0;
+               int destAddr_len = 0;
+               char[] diallingNum = new char[EnumConstants.TAPI_NETTEXT_ADDRESS_LEN_MAX+1];
+               char[] scaAddr = new char[EnumConstants.TAPI_NETTEXT_SCADDRESS_LEN_MAX+1];
+               char[] destAddr = new char[EnumConstants.TAPI_NETTEXT_ADDRESS_LEN_MAX+1];
+//             char[] inData = new char[EnumConstants.TAPI_NETTEXT_SMDATA_SIZE_MAX+1];
+
+               int position = 0;
+
+               SmsUtilDecodeAddrField_sca(diallingNum, pPDU);
+
+               position += 2;
+
+               scaAddr_len = getSize(diallingNum);
+
+               if ((scaAddr_len % 2) != 0)
+                       position += scaAddr_len / 2 + 1;
+               else
+                       position += scaAddr_len / 2;
+
+               if (ton == EnumConstants.SIM_TON_INTERNATIONAL) {
+                       scaAddr[0] = '+';
+                       for(int i = 0; i < scaAddr_len; i++) {
+                               scaAddr[i+1] = diallingNum[i];
+                               scaAddr[scaAddr_len+1] = '\0';
+                       }
+               } else {
+                       for(int i = 0; i < scaAddr_len; i++) {
+                               scaAddr[i] = diallingNum[i];
+                               scaAddr[scaAddr_len] = '\0';
+                       }
+               }
+               
+               /* TP-MTI, TP-RD, TP-VPF, TP-RP, TP_UDHI, TP-SRR */
+               tpdu_submit.msgType = EnumConstants.SMS_TPDU_SUBMIT;
+               tpdu_submit.rd = ((pPDU[position] & 0x04) != 0) ? true : false;
+               tpdu_submit.vpf = (pPDU[position] & 0x18) >> 3;
+               tpdu_submit.srr = ((pPDU[position] & 0x20) != 0) ? true : false;
+               tpdu_submit.udhi = ((pPDU[position] & 0x40) != 0) ? true : false;
+               tpdu_submit.rp = ((pPDU[position] & 0x80) != 0) ? true : false;
+               
+               position++;
+               
+               /* TP-MR */
+               tpdu_submit.mr = pPDU[position];
+               
+               position++;
+               
+               /* TP-DA */
+               for(int i = 0; i < diallingNum.length; i++)
+                       diallingNum[i] = 0x00;
+               
+               SmsUtilDecodeAddrField_dst(diallingNum, getCharArray(pPDU, position));
+               
+               position+=2;
+               
+               destAddr_len = getSize(diallingNum);
+               
+               if((destAddr_len %2) != 0)
+                       position += destAddr_len / 2 + 1;
+               else
+                       position += destAddr_len / 2;
+               
+               if (ton == EnumConstants.SIM_TON_INTERNATIONAL) {
+                       destAddr[0] = '+';
+                       for(int i = 0; i < destAddr_len; i++) {
+                               destAddr[i+1] = diallingNum[i];
+                               destAddr[destAddr_len+1] = '\0';
+                       }
+                       tpdu_submit.destAddr.dialnumlen = destAddr_len+1;
+                       for(int i = 0; i < destAddr_len+1; i++)
+                               tpdu_submit.destAddr.diallingNum[i] = destAddr[i];
+               } else {
+                       for(int i = 0; i < destAddr_len; i++) {
+                               destAddr[i] = diallingNum[i];
+                               destAddr[destAddr_len] = '\0';
+                       }
+                       tpdu_submit.destAddr.dialnumlen = destAddr_len;
+                       for(int i = 0; i < destAddr_len; i++)
+                               tpdu_submit.destAddr.diallingNum[i] = destAddr[i];
+               }
+               
+               tpdu_submit.destAddr.npi = npi;
+               tpdu_submit.destAddr.ton = ton;
+               
+               /* TP-PID */
+               tpdu_submit.pId = pPDU[position];
+               position++;
+               
+               /* TP DCS */
+               SmsUtilDecodeDCS(tpdu_submit.dcs, pPDU[position]);
+               position++;
+               
+               /* TP VP */
+//             tpdu_submit.vp.vpType = EnumConstants.TAPI_NETTEXT_VP_RELATIVE;
+               
+               switch(tpdu_submit.vp.vpType) {
+                       case EnumConstants.TAPI_NETTEXT_VP_RELATIVE:
+                               tpdu_submit.vp.vpValue = pPDU[position];
+                               tpdu_submit.vp.vpRelativeType = EnumConstants.TAPI_NETTEXT_VP_REL_1D;
+                               position++;
+                               break;
+                       case EnumConstants.TAPI_NETTEXT_VP_ABSOLUTE:
+                       case EnumConstants.TAPI_NETTEXT_VP_ENHANCED:
+                               position += 7;
+                               break;
+                       default:
+                               break;
+               }
+               
+               /* TP UDL */
+               tpdu_submit.udl = pPDU[position] & 0x00FF;
+               
+               if(tpdu_submit.udl > EnumConstants.TAPI_NETTEXT_SMDATA_SIZE_MAX)
+                       tpdu_submit.udl = EnumConstants.TAPI_NETTEXT_SMDATA_SIZE_MAX;
+               
+               position++;
+               
+               /* TP UD */
+               if(tpdu_submit.udhi)
+               {
+                       udhl = pPDU[position];
+                       int fillbits = 7 - ((pPDU[position] * 8) % 7);
+                       position += udhl;
+                       udhl += fillbits;
+                       
+                       if(pPDU[position] == 1)
+                       {
+                               relay_cnt = pPDU[position - 1];
+                               for(int i = 0; i < smsbuffer.length; i++)
+                                       smsbuffer[i] = '\0';
+                       }
+                       position++;
+                       
+                       relayedsms = true;
+               }
+               else
+               {
+                       if(relayedsms)
+                       {
+                               for(int i = 0; i < smsbuffer.length; i++)
+                                       smsbuffer[i] = '\0';
+                               
+                               smsbuffer_index = 0;
+                               relayedsms = false;
+                       }
+               }
+               
+               int i = 0;
+               tpdu_submit.userData = new char[EnumConstants.TAPI_NETTEXT_SMDATA_SIZE_MAX+1];
+               //System.out.println("Position : " + position);
+               if(tpdu_submit.dcs.alphabetType == EnumConstants.TAPI_NETTEXT_ALPHABET_DEFAULT) {
+                       char[] inData = new char[EnumConstants.TAPI_NETTEXT_SMDATA_SIZE_MAX+1];
+                       for(i = 0; i < tpdu_submit.udl; i++) {
+                               inData[i] = (char)(pPDU[position + i] & 0xff);
+                               if(relay_cnt == 1)      // last or single sms
+                               {
+                                       if(i == tpdu_submit.udl - udhl)
+                                               break;
+                               }
+                               else
+                               {
+                                       if(tpdu_submit.udhi == true)
+                                       {
+                                               if(i == tpdu_submit.udl - udhl)
+                                                       break;
+                                       }
+                                       else
+                                       {
+                                               if(i == tpdu_submit.udl)
+                                                       break;
+                                       }
+                               }
+                       }
+                       
+                       inData[i] = '\0';
+                       
+                       for(int j = 0; j < i; j++) {
+                               tpdu_submit.userData[j] = inData[j];    
+                       }
+                       
+                       if(relayedsms)
+                       {
+                               String tmp1 = new String(smsbuffer);
+                               String tmp2 = new String(inData);
+                               String tmp3 = tmp1.trim() + tmp2.trim();
+                               smsbuffer = tmp3.toCharArray();
+                       }
+                       // SmsUtilUnpackGSMCode(tpdu_submit.userData, inData, tpdu_submit.udl);
+               }
+               else if(tpdu_submit.dcs.alphabetType == EnumConstants.TAPI_NETTEXT_ALPHABET_UCS2)
+               {
+                       byte[] inData = new byte[EnumConstants.TAPI_NETTEXT_SMDATA_SIZE_MAX+1];
+                       for(i = 0; i < tpdu_submit.udl; i++) {
+                               inData[i] = (byte)(pPDU[position + i] & 0xff);
+                               if(relay_cnt == 1)      // last or single sms
+                               {
+                                       if(i == tpdu_submit.udl - udhl + 1)
+                                               break;
+                               }
+                               else
+                               {
+                                       if(tpdu_submit.udhi == true)
+                                       {
+                                               if(i == tpdu_submit.udl - udhl)
+                                                       break;
+                                       }
+                                       else
+                                       {
+                                               if(i == tpdu_submit.udl)
+                                                       break;
+                                       }
+                               }
+                       }
+                       
+                       try {
+                               inData[i] = '\0';
+                               tpdu_submit.userData = ucs2ToUTF16(inData, i/2);        
+                       } catch (UnsupportedEncodingException e) {
+                               // TODO Auto-generated catch block
+                               e.printStackTrace();
+                       }
+               }
+       
+               if(tpdu_submit.srr)
+               {
+               //      System.out.println("SRR: A status report is requested");
+                       deliveryReportNum_set.add(String.valueOf(diallingNum).trim());
+                       deliveryReport = true;
+               }
+               else
+               {
+               //      System.out.println("SRR: A status report is not requested");
+                       deliveryReport = false;
+               }
+               isDecodeEnd = true;
+       }
+
+       private char[] getCharArray(char[] org, int start) {
+               int length = org.length - start;
+               char[] result = new char[length];
+               
+               for(int i = 0; i < length; i++) {
+                       result[i] = org[start + i];
+               }
+               return result;
+       }
+       
+       private void SmsUtilDecodeDCS(TapiNetTextCodingScheme pCodingScheme, char dcs) {
+               if ( dcs < 0x40 ) { // bits 7..4 = 00xx : general data coding indication
+                       pCodingScheme.codingGroupType = EnumConstants.TAPI_NETTEXT_CODGRP_SM_GENERAL_DCS;
+
+                       if ((dcs & 0x20) != 0) // bit 5 = 1 : indicates the text is compressed
+                               pCodingScheme.bCompressed = true;
+
+                       if ((dcs & 0x10) != 0) // bit 4 = 1 : indicates that bits  1 to 0 have a message class meaning
+                       {
+                               pCodingScheme.bMsgClassSet = true;
+
+                               switch ( dcs & 0x03 ) // bits 1 to 0 : message class
+                               {
+                                       case 0x00:
+                                               pCodingScheme.classType = EnumConstants.TAPI_NETTEXT_CLASS_0;
+                                               break;
+                                       case 0x01:
+                                               pCodingScheme.classType = EnumConstants.TAPI_NETTEXT_CLASS_1;
+                                               break;
+                                       case 0x02:
+                                               pCodingScheme.classType = EnumConstants.TAPI_NETTEXT_CLASS_2;
+                                               break;
+                                       case 0x03:
+                                               pCodingScheme.classType = EnumConstants.TAPI_NETTEXT_CLASS_3;
+                                               break;
+                                       default:
+                                               break;
+                               }
+                       }
+                       else // bit 4 = 0 : indicates that bits 1 to 0 are reserved and have no message class meaning
+                               pCodingScheme.classType = EnumConstants.TAPI_NETTEXT_CLASS_NONE;
+
+                       switch ( dcs & 0x0C ) // bits 4 to 3 : character set
+                       {
+                               case 0x00:
+                                       pCodingScheme.alphabetType = EnumConstants.TAPI_NETTEXT_ALPHABET_DEFAULT;
+                                       break;
+                               case 0x04:
+                                       pCodingScheme.alphabetType = EnumConstants.TAPI_NETTEXT_ALPHABET_8BIT;
+                                       break;
+                               case 0x08:
+                                       pCodingScheme.alphabetType = EnumConstants.TAPI_NETTEXT_ALPHABET_UCS2;
+                                       break;
+                               case 0x0C:
+                                       pCodingScheme.alphabetType = EnumConstants.TAPI_NETTEXT_ALPHABET_MAX;
+                                       break;
+                               default:
+                                       break;
+                       }
+               }
+               else if ( dcs >= 0x40 && dcs < 0x80 ) // bits 7..4 = 01xx : message marked for automatic deletion group. bits 5..0 are coded exactly the same as group 00xx
+               {
+                       pCodingScheme.codingGroupType = EnumConstants.TAPI_NETTEXT_CODGRP_SM_AUTO_DELETION;
+
+                       if ((dcs & 0x20) != 0) // bit 5 = 1 : indicates the text is compressed
+                               pCodingScheme.bCompressed = true;
+
+                       if ((dcs & 0x10) != 0) // bit 4 = 1 : indicates that bits  1 to 0 have a message class meaning
+                       {
+                               pCodingScheme.bMsgClassSet = true;
+
+                               switch ( dcs & 0x03 ) // bits 1 to 0 : message class
+                               {
+                                       case 0x00:
+                                               pCodingScheme.classType = EnumConstants.TAPI_NETTEXT_CLASS_0;
+                                               break;
+                                       case 0x01:
+                                               pCodingScheme.classType = EnumConstants.TAPI_NETTEXT_CLASS_1;
+                                               break;
+                                       case 0x02:
+                                               pCodingScheme.classType = EnumConstants.TAPI_NETTEXT_CLASS_2;
+                                               break;
+                                       case 0x03:
+                                               pCodingScheme.classType = EnumConstants.TAPI_NETTEXT_CLASS_3;
+                                               break;
+                                       default:
+                                               break;
+                               }
+                       }
+                       else // bit 4 = 0 : indicates that bits 1 to 0 are reserved and have no message class meaning
+                               pCodingScheme.classType = EnumConstants.TAPI_NETTEXT_CLASS_NONE;
+
+                       switch ( dcs & 0x0C ) // bits 4 to 3 : character set
+                       {
+                               case 0x00:
+                                       pCodingScheme.alphabetType = EnumConstants.TAPI_NETTEXT_ALPHABET_DEFAULT;
+                                       break;
+                               case 0x04:
+                                       pCodingScheme.alphabetType = EnumConstants.TAPI_NETTEXT_ALPHABET_8BIT;
+                                       break;
+                               case 0x08:
+                                       pCodingScheme.alphabetType = EnumConstants.TAPI_NETTEXT_ALPHABET_UCS2;
+                                       break;
+                               case 0x0C:
+                                       pCodingScheme.alphabetType = EnumConstants.TAPI_NETTEXT_ALPHABET_MAX;
+                                       break;
+                               default:
+                                       break;
+                       }
+               }
+               // bits 7..4 = 1000 ~ 1011 : reserved
+               else if (dcs == 0xC0) // bits 7..4 = 1100 : message waiting indication group, discard message
+               {
+                       pCodingScheme.codingGroupType = EnumConstants.TAPI_NETTEXT_CODGRP_SM_WAITING_DISCARD;
+               }
+               else if (dcs < 0xE0)
+               {
+                       pCodingScheme.codingGroupType = EnumConstants.TAPI_NETTEXT_CODGRP_SM_WAITING_STORE;
+
+                       if ((dcs & 0x08) != 0)
+                               pCodingScheme.bMsgIndActive = true;
+
+                       switch (dcs & 0x03)
+                       {
+                               case 0x00:
+                                       pCodingScheme.waitingType = EnumConstants.TAPI_NETTEXT_WAITING_VOICE_MSG;
+                                       break;
+                               case 0x01:
+                                       pCodingScheme.waitingType = EnumConstants.TAPI_NETTEXT_WAITING_FAX_MSG;
+                                       break;
+                               case 0x02:
+                                       pCodingScheme.waitingType = EnumConstants.TAPI_NETTEXT_WAITING_EMAIL_MSG;
+                                       break;
+                               case 0x03:
+                                       pCodingScheme.waitingType = EnumConstants.TAPI_NETTEXT_WAITING_OTHER_MSG;
+                                       break;
+                               default:
+                                       break;
+                       }
+               }
+               else if (dcs < 0xF0)
+               {
+                       pCodingScheme.codingGroupType = EnumConstants.TAPI_NETTEXT_CODGRP_SM_WAITING_STORE_UCS2;
+
+                       if ((dcs & 0x08) != 0)
+                               pCodingScheme.bMsgIndActive = true;
+
+                       switch (dcs & 0x03)
+                       {
+                               case 0x00:
+                                       pCodingScheme.waitingType = EnumConstants.TAPI_NETTEXT_WAITING_VOICE_MSG;
+                                       break;
+                               case 0x01:
+                                       pCodingScheme.waitingType = EnumConstants.TAPI_NETTEXT_WAITING_FAX_MSG;
+                                       break;
+                               case 0x02:
+                                       pCodingScheme.waitingType = EnumConstants.TAPI_NETTEXT_WAITING_EMAIL_MSG;
+                                       break;
+                               case 0x03:
+                                       pCodingScheme.waitingType = EnumConstants.TAPI_NETTEXT_WAITING_OTHER_MSG;
+                                       break;
+                               default:
+                                       break;
+                       }
+               }
+               else
+               {
+                       pCodingScheme.codingGroupType = EnumConstants.TAPI_NETTEXT_CODGRP_SM_CLASS_CODING;
+
+                       if ((dcs & 0x04) != 0)
+                               pCodingScheme.alphabetType = EnumConstants.TAPI_NETTEXT_ALPHABET_8BIT;
+
+                       switch (dcs & 0x03)
+                       {
+                               case 0x00:
+                                       pCodingScheme.classType = EnumConstants.TAPI_NETTEXT_CLASS_0;
+                                       break;
+                               case 0x01:
+                                       pCodingScheme.classType = EnumConstants.TAPI_NETTEXT_CLASS_1;
+                                       break;
+                               case 0x02:
+                                       pCodingScheme.classType = EnumConstants.TAPI_NETTEXT_CLASS_2;
+                                       break;
+                               case 0x03:
+                                       pCodingScheme.classType = EnumConstants.TAPI_NETTEXT_CLASS_3;
+                                       break;
+                               default:
+                                       break;
+                       }
+               }
+       }
+
+       private void SmsUtilDecodeAddrField_sca(char[] diallingNum, char[] pAddrField) {
+//             int ton, npi;
+               int index = 0;
+               int dialnumLen = 0;
+               int length = 0;
+               
+               ton = (pAddrField[index+1] & 0x70) >> 4;
+               npi = pAddrField[index+1] & 0x0F;
+               
+               if(ton != EnumConstants.SIM_TON_ALPHA_NUMERIC) {
+                       length = pAddrField[index];
+                       if(length > 1)
+                               dialnumLen = (pAddrField[index++] - 1) * 2;
+               } else
+                       dialnumLen = (((pAddrField[index++] + 1) / 2) * 8) / 7;
+
+               if(dialnumLen > EnumConstants.SIM_SMSP_ADDRESS_LEN)
+                       dialnumLen = EnumConstants.SIM_SMSP_ADDRESS_LEN;
+               
+               // Ignore type of address field
+               index++;
+               
+               if(ton != EnumConstants.SIM_TON_ALPHA_NUMERIC)
+                       SmsUtilConvertBCD2Digit(diallingNum, getCharArray(pAddrField, index), dialnumLen);
+               else
+                       SmsUtilUnpackGSMCode(diallingNum, getCharArray(pAddrField, index), dialnumLen);
+       }
+       
+       private void SmsUtilDecodeAddrField_dst(char[] diallingNum, char[] pAddrField) {
+//             int ton, npi;
+               int index = 0;
+               int dialnumLen = 0;
+               
+               ton = (pAddrField[index+1] & 0x70) >> 4;
+               npi = pAddrField[index+1] & 0x0F;
+               
+               if(ton != EnumConstants.SIM_TON_ALPHA_NUMERIC)
+                       dialnumLen = pAddrField[index++];
+               else
+                       dialnumLen = (((pAddrField[index++] + 1) / 2) * 8) / 7;
+               
+               if(dialnumLen > EnumConstants.SIM_SMSP_ADDRESS_LEN)
+                       dialnumLen = EnumConstants.SIM_SMSP_ADDRESS_LEN;
+               
+               // Ignore type of address field
+               index++;
+               
+               if(ton != EnumConstants.SIM_TON_ALPHA_NUMERIC)
+                       SmsUtilConvertBCD2Digit(diallingNum, getCharArray(pAddrField, index), dialnumLen);
+               else
+                       SmsUtilUnpackGSMCode(diallingNum, getCharArray(pAddrField, index), dialnumLen);
+               System.out.println(diallingNum);
+       }
+       
+       private void SmsUtilConvertBCD2Digit(char[] pDigits, char[] pBCD, int digitLen) {
+               int i, bcdLen;
+               char[] c = {0x00, 0x00};
+               char higher, lower;
+               
+               if(pBCD == null || pDigits == null){
+                       //throw new NullPointerException("SmsUtilConvertBCD2Digit"); //$NON-NLS-1$
+                       System.out.println("pBCD or pDigits shouldn't be null");
+                       throw null;
+               }
+               
+               if(digitLen == 0) {
+                       pDigits[0] = 0x00;
+                       return;
+               }
+               
+               if((digitLen % 2) != 0)
+                       bcdLen = digitLen / 2 + 1;
+               else
+                       bcdLen = digitLen / 2;
+               
+               for(i = 0; i < bcdLen; i++) {
+                       lower = (char)(pBCD[i] & 0x0F);
+                       
+                       if(lower == 0x0A)
+                               lower = '*';
+                       else if(lower == 0x0B)
+                               lower = '#';
+                       else if(lower == 0x0C)
+                               lower = 'p';
+                       else if(lower == 0x0F)
+                               lower = 0;
+                       else {
+                               AcItoa(lower, c, 16);
+                               lower = (char)AcToupper(c[0]);
+                       }
+                       
+                       higher = (char)((pBCD[i] >> 4) & 0x0F);
+                       
+                       if(higher == 0x0A)
+                               higher = '*';
+                       else if(higher == 0x0B)
+                               higher = '#';
+                       else if(higher == 0x0C)
+                               higher = 'p';
+                       else if(higher == 0x0F) {
+                               pDigits[getSize(pDigits)] = lower;
+                               pDigits[bcdLen*2-1] = '\0';
+                               return;
+                       }
+                       else {
+                               AcItoa(higher, c, 16);
+                               higher = (char)AcToupper(c[0]);
+                       }
+                       pDigits[getSize(pDigits)] = lower;
+                       pDigits[getSize(pDigits)] = higher;
+               }
+               pDigits[digitLen] = '\0';
+       }
+       
+       private int getSize(char[] array) {
+               int ret = 0;
+               String str = new String(array);
+               ret = str.indexOf('\0');
+               return ret;
+       }
+       
+       private int AcToupper(int ch) {
+               return (('a' <= (ch) && (ch) <= 'z') ? ((ch) - ('a' - 'A')) : (ch));
+       }
+       
+       private void AcItoa(int n, char[] str, int b) {
+               int i = 0;
+               String arr = new String("0123456789ABCDEF"); //$NON-NLS-1$
+               do
+                       str[i++] = arr.charAt(n%b);
+               while((n /= b) > 0);
+               reverse(str, i);
+               str[i] = '\0';
+       }
+       
+       private void reverse(char[] x, int len) {
+               int i, j = len-1;
+               for(i = 0; i < j; i++) {
+                       char t = x[i];
+                       x[i] = x[j];
+                       x[j--] = t;
+               }
+       }
+       
+       private void SmsUtilUnpackGSMCode(char[] szData, char[] pIn, int in_len) {
+               int shift = 0;
+               int pos = 0;
+               
+               for(int i = 0; i < in_len; i++, pos++) {
+                       szData[i] = (char)((pIn[pos] << shift) & 0x7F);
+                       if(pos != 0) {
+                               /* except the first byte, a character contains some bits
+                                * from the previous byte
+                                */
+                               szData[i] |= pIn[pos-1] >> (8-shift);
+                       }
+                       shift++;
+                       
+                       if(shift == 7) {
+                               shift = 0;
+                               /* a possible extra complete character is available */
+                               i++;
+                               szData[i] = (char)(pIn[pos] >> 1);
+                               /* This is the end of the input, quit */
+                               if(szData[i] == 0)
+                                       break;
+                       }
+               }
+       }
+       
+       public char[] ucs2ToUTF16(byte[] ucs2Bytes, int length) throws UnsupportedEncodingException{    
+               String unicode = new String(ucs2Bytes, "UTF-16");
+               char[] str = unicode.toCharArray();
+               
+               String tmp1 = new String(smsbuffer);
+               String tmp2 = unicode.substring(0, length);
+               String tmp3 = tmp1.trim() + tmp2.trim();
+               smsbuffer = tmp3.toCharArray();
+
+               return str;
+       }
+}
diff --git a/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/EncodeMsg.java b/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/EncodeMsg.java
new file mode 100644 (file)
index 0000000..bcb6c71
--- /dev/null
@@ -0,0 +1,584 @@
+/*
+ * org.tizen.injector.telephony.sms
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.sms.encription;
+
+public class EncodeMsg {
+       int index;
+
+       public int EncodeSmsDeliverTpdu(SmsAddressInfo SCA,
+                       TPDU_SMS_DELIVER tpdu_deliver, char[] packet, int pid, int dcs) {
+               // char tp_dcs; // BYTE
+               char[] timeStamp = new char[21];
+               char[] scaNumber = new char[21];
+               char[] orgNumber = new char[21];
+               int scaLength;
+               int orgLength;
+               int i;
+
+               index = 0;
+
+               if (SCA.diallingNum[0] == '+') {
+                       SCA.ton = 1;
+                       SCA.npi = 1;
+                       for (i = 0; i < SCA.dialnumlen-1; i++) {
+                               scaNumber[i] = SCA.diallingNum[i + 1];
+                       }
+                       scaLength = SCA.dialnumlen - 1;
+                       scaNumber[scaLength] = '\0';
+               } else {
+                       SCA.ton = 0;
+                       SCA.npi = 0;
+                       for (i = 0; i < SCA.dialnumlen; i++) {
+                               scaNumber[i] = SCA.diallingNum[i];
+                       }
+                       scaLength = SCA.dialnumlen;
+                       scaNumber[scaLength] = '\0';
+               }
+
+               SmsUtilEncodeAddrField_sca(packet, scaNumber, scaLength, SCA.ton, SCA.npi);
+
+               tpdu_deliver.msgType = EnumConstants.SMS_TPDU_DELIVER;
+
+               packet[index] = (char) tpdu_deliver.msgType;
+               packet[index] |= tpdu_deliver.mms ? 0x04 : 0;
+               packet[index] |= tpdu_deliver.sri ? 0x20 : 0;
+               packet[index] |= tpdu_deliver.udhi ? 0x40 : 0;
+               packet[index] |= tpdu_deliver.rp ? 0x80 : 0;
+
+               index++;
+               
+               if (tpdu_deliver.orgAddr.diallingNum[0] == '+') {
+                       tpdu_deliver.orgAddr.ton = 1;
+                       tpdu_deliver.orgAddr.npi = 1;
+                       for (i = 0; i < tpdu_deliver.orgAddr.dialnumlen-1; i++) {
+                               orgNumber[i] = tpdu_deliver.orgAddr.diallingNum[i + 1];
+                       }
+                       orgLength = tpdu_deliver.orgAddr.dialnumlen - 1;
+                       orgNumber[orgLength] = '\0';
+               } else {
+                       tpdu_deliver.orgAddr.ton = 0;
+                       tpdu_deliver.orgAddr.npi = 0;
+                       for (i = 0; i < tpdu_deliver.orgAddr.dialnumlen; i++) {
+                               orgNumber[i] = tpdu_deliver.orgAddr.diallingNum[i];
+                       }
+                       orgLength = tpdu_deliver.orgAddr.dialnumlen;
+                       orgNumber[orgLength] = '\0';
+               }
+
+               /* TP-OA */
+               SmsUtilEncodeAddrField_dst(packet, orgNumber, orgLength, tpdu_deliver.orgAddr.ton, tpdu_deliver.orgAddr.npi);
+
+               /* TP-PID */
+               packet[index++] = (char) pid;
+
+               int tp_dcs = SmsUtilEncodeDCS(tpdu_deliver.dcs);
+
+               packet[index++] = (char) tp_dcs;
+
+               SmsUtilEncodeTimeStamp(tpdu_deliver.scts, timeStamp);
+
+               for (i = 0; i < 7; i++) {
+                       packet[index++] = timeStamp[i];
+               }
+
+               /* TP-UD */
+               switch(tpdu_deliver.dcs.alphabetType) {
+                       case EnumConstants.TAPI_NETTEXT_ALPHABET_DEFAULT:
+                               /* UDL */
+                               packet[index++] = (char) tpdu_deliver.userData.data.length;
+                               SmsUtilPackGSMCode(packet, new String(tpdu_deliver.userData.data).toCharArray(),
+                                               tpdu_deliver.userData.data.length);
+                               break;
+                       case EnumConstants.TAPI_NETTEXT_ALPHABET_8BIT:
+                               packet[index++] = (char) tpdu_deliver.userData.data.length;
+                               SmsUtilPackGSM8Code(packet, new String(tpdu_deliver.userData.data).toCharArray(),
+                                               tpdu_deliver.userData.data.length);
+                               break;
+                       case EnumConstants.TAPI_NETTEXT_ALPHABET_UCS2:
+                               int udhl                = 0;
+                               int fillBits    = 0;
+                               int tempIndex   = index;
+
+                               if (tpdu_deliver.userData.headerCnt > 0)
+                                       index = index + 2;
+                               else
+                                       index = index + 1;
+
+                               // setting HEADER
+                               int headerLen   = 6;
+                               if (tpdu_deliver.ported) { // when port addressing used
+                                       index++;
+                                       packet[index++] = 0x05; // 16bit_port_addressing_code;
+                                       packet[index++] = 0x04; // offset below octets
+                                       packet[index++] = (char)(tpdu_deliver.port >> 8);               //destination port 1st octet
+                                       packet[index++] = (char)(tpdu_deliver.port & 0x00FF);   //destination port 2nd octet
+                                       packet[index++] = (char)(tpdu_deliver.port >> 8);               //originator port 1st octet
+                                       packet[index++] = (char)(tpdu_deliver.port & 0x00FF);   //originator port 2nd octet
+                                       udhl += headerLen;
+                               }
+
+                               for (i = 0; i < tpdu_deliver.userData.headerCnt; i++)
+                               {
+                                       packet[index++] = 0x08; // SMS_UDH_CONCAT_16BIT;
+                                       packet[index++] = 0x04; // offset
+                                       packet[index++] = (char)(tpdu_deliver.userData.smsUDH.msgRef >> 8);
+                                       packet[index++] = (char)(tpdu_deliver.userData.smsUDH.msgRef & 0x00FF);
+                                       packet[index++] = tpdu_deliver.userData.smsUDH.totalSeg;
+                                       packet[index++] = tpdu_deliver.userData.smsUDH.seqNum;
+                                       udhl += headerLen;
+                               }
+
+                               if (udhl > 0) {
+                                       packet[tempIndex]        = (char)((udhl+1) + fillBits + tpdu_deliver.userData.length);
+                                       packet[tempIndex+ 1] = (char)udhl;
+                               } else {
+                                       packet[tempIndex]       = (char)(tpdu_deliver.userData.length);
+                               }
+
+                               for(int ind = 0; ind < tpdu_deliver.userData.length; ind++) {
+                                       packet[index++] = (char)tpdu_deliver.userData.data[ind];
+                               }
+                               break;
+                       //      throw new NullPointerException(Messages.EncodeMsg_0);
+                       default:
+                               //throw new NullPointerException(Messages.EncodeMsg_1);
+                               throw null;
+               }
+
+               return index;
+       }
+
+       private void SmsUtilPackGSMCode(char[] pOut, char[] szData, int in_len) {
+               int shift = 0;
+
+               for (int i = 0; i < in_len; index++, i++) {
+                       /* pack the high bits using the low bits of the next character */
+                       pOut[index] = (char) (szData[i] >> shift);
+                       if (i + 1 < in_len) {
+                               /* pack the high bits using the low bits of the next character */
+                               pOut[index] |= szData[i + 1] << (7 - shift);
+                               pOut[index] &= 0xFF;
+                               shift++;
+
+                               if (shift == 7) {
+                                       shift = 0;
+                                       i++;
+                               }
+                       }
+               }
+       }
+
+       private void SmsUtilPackGSM8Code(char[] pOut, char[] szData, int in_len) {
+               for(int i = 0; i < in_len; i++) {
+                       pOut[index++] = szData[i];
+               }
+       }
+       
+       private void SmsUtilEncodeTimeStamp(TmDateTime tmDateTime, char[] timeStamp) {
+               char[] szBuf = new char[3];
+               char[] tmpBuf = new char[20];
+               int year;
+
+               for (int i = 0; i < 7; i++) {
+                       timeStamp[i] = 0x00;
+               }
+
+               year = tmDateTime.year - 2000;
+               if (year < 0)
+                       year += 100;
+
+               szBuf = String.format("%02d", year).toCharArray(); //$NON-NLS-1$
+               SmsUtilConvertDigit2BCD(tmpBuf, szBuf, 2);
+               timeStamp[0] = tmpBuf[0];
+               szBuf = String.format("%02d", tmDateTime.month).toCharArray(); //$NON-NLS-1$
+               SmsUtilConvertDigit2BCD(tmpBuf, szBuf, 2);
+               timeStamp[1] = tmpBuf[0];
+               szBuf = String.format("%02d", tmDateTime.day).toCharArray(); //$NON-NLS-1$
+               SmsUtilConvertDigit2BCD(tmpBuf, szBuf, 2);
+               timeStamp[2] = tmpBuf[0];
+               szBuf = String.format("%02d", tmDateTime.hour).toCharArray(); //$NON-NLS-1$
+               SmsUtilConvertDigit2BCD(tmpBuf, szBuf, 2);
+               timeStamp[3] = tmpBuf[0];
+               szBuf = String.format("%02d", tmDateTime.minute).toCharArray(); //$NON-NLS-1$
+               SmsUtilConvertDigit2BCD(tmpBuf, szBuf, 2);
+               timeStamp[4] = tmpBuf[0];
+               szBuf = String.format("%02d", tmDateTime.second).toCharArray(); //$NON-NLS-1$
+               SmsUtilConvertDigit2BCD(tmpBuf, szBuf, 2);
+               timeStamp[5] = tmpBuf[0];
+               szBuf = String.format("%02d", 0x00).toCharArray(); //$NON-NLS-1$
+               SmsUtilConvertDigit2BCD(tmpBuf, szBuf, 2);
+               timeStamp[6] = tmpBuf[0];
+       }
+
+       private char SmsUtilEncodeDCS(TapiNetTextCodingScheme codingScheme) {
+               char dcs = 0x00;
+
+               switch (codingScheme.codingGroupType) {
+               case EnumConstants.TAPI_NETTEXT_CODGRP_SM_GENERAL_DCS: // bit 7..4 is
+                                                                                                                               // 00xx
+               {
+                       if (codingScheme.bCompressed)
+                               dcs |= 0x20; // bit 5 is 1
+
+                       if (codingScheme.bMsgClassSet) {
+                               dcs |= 0x10; // bit 4 is 1
+
+                               switch (codingScheme.classType) {
+                               case EnumConstants.TAPI_NETTEXT_CLASS_0: // bit 1..0 is 00
+                               {
+                                       dcs |= 0x00;
+                                       break;
+                               }
+                               case EnumConstants.TAPI_NETTEXT_CLASS_1: // bit 1..0 is 01
+                               {
+                                       dcs |= 0x01;
+                                       break;
+                               }
+                               case EnumConstants.TAPI_NETTEXT_CLASS_2: // bit 1..0 is 10
+                               {
+                                       dcs |= 0x02;
+                                       break;
+                               }
+                               case EnumConstants.TAPI_NETTEXT_CLASS_3: // bit 1..0 is 11
+                               {
+                                       dcs |= 0x03;
+                                       break;
+                               }
+                               default:
+                                       break;
+                               }
+                       }
+
+                       switch (codingScheme.alphabetType) {
+                       case EnumConstants.TAPI_NETTEXT_ALPHABET_DEFAULT: // bit 3..2 is 00
+                       {
+                               dcs |= 0x00;
+                               break;
+                       }
+                       case EnumConstants.TAPI_NETTEXT_ALPHABET_8BIT: // bit 3..2 is 01
+                       {
+                               dcs |= 0x04;
+                               break;
+                       }
+                       case EnumConstants.TAPI_NETTEXT_ALPHABET_UCS2: // bit 3..2 is 10
+                       {
+                               dcs |= 0x08;
+                               break;
+                       }
+                       default: // bit 3..2 is 11
+                       {
+                               dcs |= 0x0C;
+                               break;
+                       }
+                       }
+
+                       break;
+               }
+               case EnumConstants.TAPI_NETTEXT_CODGRP_SM_WAITING_DISCARD: // bit 7..4
+                                                                                                                                       // is 1100
+               {
+                       dcs |= 0xC0;
+
+                       break;
+               }
+               case EnumConstants.TAPI_NETTEXT_CODGRP_SM_WAITING_STORE: // bit 7..4 is
+                                                                                                                                       // 1101
+               {
+                       dcs |= 0xD0;
+
+                       if (codingScheme.bMsgIndActive) // bit 3..2 is 10
+                               dcs |= 0x08;
+
+                       switch (codingScheme.waitingType) {
+                       case EnumConstants.TAPI_NETTEXT_WAITING_VOICE_MSG: // bit 1..0 is 00
+                       {
+                               dcs |= 0x00;
+                               break;
+                       }
+                       case EnumConstants.TAPI_NETTEXT_WAITING_FAX_MSG: // bit 1..0 is 01
+                       {
+                               dcs |= 0x01;
+                               break;
+                       }
+                       case EnumConstants.TAPI_NETTEXT_WAITING_EMAIL_MSG: // bit 1..0 is 10
+                       {
+                               dcs |= 0x02;
+                               break;
+                       }
+                       case EnumConstants.TAPI_NETTEXT_WAITING_OTHER_MSG: // bit 1..0 is 11
+                       {
+                               dcs |= 0x03;
+                               break;
+                       }
+                       default:
+                               break;
+                       }
+
+                       break;
+               }
+               case EnumConstants.TAPI_NETTEXT_CODGRP_SM_WAITING_STORE_UCS2: // bit
+                                                                                                                                               // 7..4
+                                                                                                                                               // is
+                                                                                                                                               // 1110
+               {
+                       dcs |= 0xE0;
+
+                       if (codingScheme.bMsgIndActive) // bit 3..2 is 10
+                               dcs |= 0x08;
+
+                       switch (codingScheme.waitingType) {
+                       case EnumConstants.TAPI_NETTEXT_WAITING_VOICE_MSG: // bit 1..0 is 00
+                       {
+                               dcs |= 0x00;
+                               break;
+                       }
+                       case EnumConstants.TAPI_NETTEXT_WAITING_FAX_MSG: // bit 1..0 is 01
+                       {
+                               dcs |= 0x01;
+                               break;
+                       }
+                       case EnumConstants.TAPI_NETTEXT_WAITING_EMAIL_MSG: // bit 1..0 is 10
+                       {
+                               dcs |= 0x02;
+                               break;
+                       }
+                       case EnumConstants.TAPI_NETTEXT_WAITING_OTHER_MSG: // bit 1..0 is 11
+                       {
+                               dcs |= 0x03;
+                               break;
+                       }
+                       default:
+                               break;
+                       }
+
+                       break;
+               }
+               case EnumConstants.TAPI_NETTEXT_CODGRP_SM_CLASS_CODING: // bit 7..4 is
+                                                                                                                               // 1111
+               {
+                       dcs |= 0xF0;
+
+                       switch (codingScheme.alphabetType) {
+                       case EnumConstants.TAPI_NETTEXT_ALPHABET_DEFAULT: // bit 2 is 0
+                       {
+                               dcs |= 0x00;
+                               break;
+                       }
+                       case EnumConstants.TAPI_NETTEXT_ALPHABET_8BIT: // bit 2 is 1
+                       {
+                               dcs |= 0x04;
+                               break;
+                       }
+                       default:
+                               break;
+                       }
+
+                       switch (codingScheme.classType) {
+                       case EnumConstants.TAPI_NETTEXT_CLASS_0: // bit 1..0 is 00
+                       {
+                               break;
+                       }
+                       case EnumConstants.TAPI_NETTEXT_CLASS_1: // bit 1..0 is 01
+                       {
+                               dcs |= 0x01;
+                               break;
+                       }
+                       case EnumConstants.TAPI_NETTEXT_CLASS_2: // bit 1..0 is 10
+                       {
+                               dcs |= 0x02;
+                               break;
+                       }
+                       case EnumConstants.TAPI_NETTEXT_CLASS_3: // bit 1..0 is 11
+                       {
+                               dcs |= 0x03;
+                               break;
+                       }
+                       default:
+                               break;
+                       }
+
+                       break;
+               }
+               case EnumConstants.TAPI_NETTEXT_CODGRP_SM_RESERVED: // bit 7..4 is 1111
+               {
+                       dcs = (char) ((codingScheme.codingGroup << 4) & 0xF0);
+                       dcs |= (codingScheme.code & 0x0F);
+                       break;
+               }
+               default:
+                       break;
+               }
+               return dcs;
+       }
+       
+       private void SmsUtilEncodeAddrField_sca(char[] pAddrField, char[] diallingNum,
+                       int dialnumLen, int ton, int npi) {
+//             int index = 0;
+               
+               if (pAddrField == null || diallingNum == null){
+                       //throw new NullPointerException("SmsUtilEncodeAddrField"); //$NON-NLS-1$
+                       System.out.println("packet or diallingNum shouldn't be null");
+                       throw null;
+               }
+
+               if (ton != EnumConstants.SIM_TON_ALPHA_NUMERIC) {
+                       if((dialnumLen % 2) != 0) {
+                               pAddrField[index++] = (char)(dialnumLen / 2 + 1 + 1);
+                       } else {
+                               pAddrField[index++] = (char)(dialnumLen / 2 + 1);
+                       }
+               } else {
+                       pAddrField[index] = (char) (((dialnumLen * 7 + 7) / 8) * 2);
+                       if (((dialnumLen * 7) % 8) <= 4) {
+                               pAddrField[index]--;
+                       }
+                       index++;
+               }
+
+               // SET_TON_NPI
+               pAddrField[index] = 0x80;
+               pAddrField[index] |= (ton & 0x07) << 4;
+               pAddrField[index] |= npi & 0x0F;
+
+               index++;
+
+               if (ton != EnumConstants.SIM_TON_ALPHA_NUMERIC) {
+                       int i, j, k;
+                       char[] tmpBuf = new char[dialnumLen];
+                       SmsUtilConvertDigit2BCD(tmpBuf, diallingNum, dialnumLen);
+                       j = index;
+                       
+                       if((dialnumLen % 2) != 0) {
+                               index += dialnumLen / 2 + 1;
+                       }
+                       else {
+                               index += dialnumLen / 2;
+                       }
+
+                       for(i = j, k = 0; i < index; i++, k++)
+                               pAddrField[i] = tmpBuf[k];
+               } else {
+                       SmsUtilPackGSMCode(pAddrField, diallingNum, (int) dialnumLen);
+               }
+       }
+       
+       private void SmsUtilEncodeAddrField_dst(char[] packet, char[] diallingNum,
+                       int dialnumLen, int ton, int npi) {
+//             int index = 0;
+               
+               if (packet == null || diallingNum == null){
+                       //throw new NullPointerException("SmsUtilEncodeAddrField"); //$NON-NLS-1$
+                       System.out.println("packet or diallingNum shouldn't be null");
+                       throw null;
+               }
+
+               if (ton != EnumConstants.SIM_TON_ALPHA_NUMERIC) {
+                       packet[index++] = (char) dialnumLen;
+               } else {
+                       packet[index] = (char) (((dialnumLen * 7 + 7) / 8) * 2);
+                       if (((dialnumLen * 7) % 8) <= 4) {
+                               packet[index]--;
+                       }
+                       index++;
+               }
+
+               // SET_TON_NPI
+               packet[index] = 0x80;
+               packet[index] |= (ton & 0x07) << 4;
+               packet[index] |= npi & 0x0F;
+
+               index++;
+
+               if (ton != EnumConstants.SIM_TON_ALPHA_NUMERIC) {
+                       int i, j, k;
+                       char[] tmpBuf = new char[dialnumLen];
+                       for (i = 0; i < dialnumLen; i++)
+                               tmpBuf[i] = 0x00;
+
+                       SmsUtilConvertDigit2BCD(tmpBuf, diallingNum, dialnumLen);
+                       j = index;
+
+                       if ((dialnumLen % 2) != 0)
+                               index += dialnumLen / 2 + 1;
+                       else
+                               index += dialnumLen / 2;
+
+                       for (i = j, k = 0; i < index; i++, k++) {
+                               packet[i] = tmpBuf[k];
+                       }
+               } else {
+                       SmsUtilPackGSMCode(packet, diallingNum, (int) dialnumLen);
+               }
+       }
+
+       private void SmsUtilConvertDigit2BCD(char[] pBCD, char[] pDigits,
+                       long digitLen) {
+               int i, j, digit;
+               char higher, lower;
+
+               if (pBCD == null || pDigits == null){
+                       //throw new NullPointerException("SmsUtilConvertDigit2BCD"); //$NON-NLS-1$
+                       System.out.println("packet or diallingNum shouldn't be null");
+                       throw null;
+               }
+
+               for (i = 0, j = 0; i < digitLen; i = i + 2, j++) {
+                       if (pDigits[i] == '*')
+                               digit = 0x0A;
+                       else if (pDigits[i] == '#')
+                               digit = 0x0B;
+                       else if (AcToupper(pDigits[i]) == 'P')
+                               digit = 0x0C;
+                       else
+                               digit = (int) (pDigits[i] - '0');
+
+                       lower = (char) (digit & 0x0F);
+
+                       if (digitLen != i + 1) {
+                               if (pDigits[i + 1] == '*')
+                                       digit = 0x0A;
+                               else if (pDigits[i + 1] == '#')
+                                       digit = 0x0B;
+                               else if (AcToupper(pDigits[i + 1]) == 'P')
+                                       digit = 0x0C;
+                               else
+                                       digit = (int) (pDigits[i + 1] - '0');
+
+                               higher = (char) (digit & 0x0F);
+                       } else {
+                               higher = 0xFF;
+                       }
+                       pBCD[j] = (char) ((higher << 4) | lower);
+                       pBCD[j] &= 0xFF;
+               }
+       }
+
+       private int AcToupper(int ch) {
+               return (('a' <= (ch) && (ch) <= 'z') ? ((ch) - ('a' - 'A')) : (ch));
+       }
+}
diff --git a/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/EnumConstants.java b/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/EnumConstants.java
new file mode 100644 (file)
index 0000000..63c906c
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * org.tizen.injector.telephony.sms
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.sms.encription;
+
+public class EnumConstants {
+       // SmsTPDUType
+       public static final int SMS_TPDU_DELIVER = 0x00;
+       public static final int SMS_TPDU_DELIVER_REPORT = 0x00;
+       public static final int SMS_TPDU_SUBMIT = 0x01;
+       public static final int SMS_TPDU_SUBMIT_REPORT = 0x01;
+       public static final int SMS_TPDU_STATUS_REPORT = 0x02;
+       public static final int SMS_TPDU_COMMAND = 0x02;
+       public static final int SMS_PDU_INVALID_TYPE = 0x03;
+       
+       // NumberingPlan
+       public static final int NUMBERING_PLAN_IDENTIFICATION_UNKNOWN = 0x00;
+       public static final int NUMBERING_PLAN_IDENTIFICATIN_ISDN_TELEPHONE = 0x01;
+
+       // TapiNetTextCodingGroupType
+       public static final int TAPI_NETTEXT_CODGRP_SM_GENERAL_DCS = 0x00;
+       public static final int TAPI_NETTEXT_CODGRP_CB_GENERAL_LANG = 0x01;
+       public static final int TAPI_NETTEXT_CODGRP_CB_ALPHA = 0x02;
+       public static final int TAPI_NETTEXT_CODGRP_CB_RES1 = 0x03;
+       public static final int TAPI_NETTEXT_CODGRP_CB_RES2 = 0x04;
+       public static final int TAPI_NETTEXT_CODGRP_SM_AUTO_DELETION = 0x05;
+       public static final int TAPI_NETTEXT_CODGRP_CB_GENERAL_DCS = 0x06;
+       public static final int TAPI_NETTEXT_CODGRP_SM_WAITING_DISCARD = 0x07;
+       public static final int TAPI_NETTEXT_CODGRP_SM_WAITING_STORE = 0x08;
+       public static final int TAPI_NETTEXT_CODGRP_SM_WAITING_STORE_UCS2 = 0x09;
+       public static final int TAPI_NETTEXT_CODGRP_CB_WAP = 0x0A;
+       public static final int TAPI_NETTEXT_CODGRP_SM_CLASS_CODING = 0x0B;
+       public static final int TAPI_NETTEXT_CODGRP_CB_CLASS_CODING = 0x0C;
+       public static final int TAPI_NETTEXT_CODGRP_SM_RESERVED = 0x0D;
+       public static final int TAPI_NETTEXT_CODGRP_MAX = 0x0E;
+       
+       // TapiNetTextWaitingType
+       public static final int TAPI_NETTEXT_WAITING_VOICE_MSG = 0x00;
+       public static final int TAPI_NETTEXT_WAITING_FAX_MSG = 0x01;
+       public static final int TAPI_NETTEXT_WAITING_EMAIL_MSG = 0x02;
+       public static final int TAPI_NETTEXT_WAITING_OTHER_MSG = 0x03;
+       public static final int TAPI_NETTEXT_WAITING_MAX = 0x04;
+       
+       // TapiNetTextAlphabetType
+       public static final int TAPI_NETTEXT_ALPHABET_DEFAULT = 0x00;
+       public static final int TAPI_NETTEXT_ALPHABET_8BIT = 0x01;
+       public static final int TAPI_NETTEXT_ALPHABET_UCS2 = 0x02;
+       public static final int TAPI_NETTEXT_ALPHABET_KSC5601 = 0x03;
+       public static final int TAPI_NETTEXT_ALPHABET_MAX = 0x04;
+       
+       // TapiNetTextClasstype
+       public static final int TAPI_NETTEXT_CLASS_0 = 0x00;
+       public static final int TAPI_NETTEXT_CLASS_1 = 0x01;
+       public static final int TAPI_NETTEXT_CLASS_2 = 0x02;
+       public static final int TAPI_NETTEXT_CLASS_3 = 0x03;
+       public static final int TAPI_NETTEXT_CLASS_NONE = 0x04;
+       public static final int TAPI_NETTEXT_CLASS_MAX = 0x05;
+       
+       // TapiNetTextVPType
+       public static final int TAPI_NETTEXT_VP_NOT_USED = 0;
+       public static final int TAPI_NETTEXT_VP_RELATIVE = 2;
+       public static final int TAPI_NETTEXT_VP_ABSOLUTE = 3;
+       public static final int TAPI_NETTEXT_VP_ENHANCED = 1;
+       public static final int TAPI_NETTEXT_VP_MAX = 4;
+       
+       // TapiNetTextVPRelValue;
+       public static final int TAPI_NETTEXT_VP_REL_1H = 0;
+       public static final int TAPI_NETTEXT_VP_REL_6H = 1;
+       public static final int TAPI_NETTEXT_VP_REL_12H = 2;
+       public static final int TAPI_NETTEXT_VP_REL_1D = 3;
+       public static final int TAPI_NETTEXT_VP_REL_1W = 4;
+       public static final int TAPI_NETTEXT_VP_REL_1M = 5;
+       public static final int TAPI_NETTEXT_VP_REL_MAX = 6;
+       public static final int TAPI_NETTEXT_SMDATA_SIZE_MAX = 255;
+       public static final int TAPI_NETTEXT_ADDRESS_LEN_MAX = 255;
+       public static final int TAPI_NETTEXT_SCADDRESS_LEN_MAX = 20;
+       
+       // define
+       public static final int SIM_TON_INTERNATIONAL = 1;
+       public static final int SIM_TON_ALPHA_NUMERIC = 5;
+       public static final int SIM_SMSP_ADDRESS_LEN = 20;
+
+
+}
diff --git a/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/Messages.java b/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/Messages.java
new file mode 100644 (file)
index 0000000..d4cf083
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * org.tizen.injector.telephony.sms
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.sms.encription;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+       private static final String BUNDLE_NAME = "org.tizen.injector.telephony.sms.encription.messages"; //$NON-NLS-1$
+       public static String EncodeMsg_0;
+       public static String EncodeMsg_1;
+       static {
+               // initialize resource bundle
+               NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+       }
+
+       private Messages() {
+       }
+}
diff --git a/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/SMS_USERDATA.java b/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/SMS_USERDATA.java
new file mode 100644 (file)
index 0000000..e38f644
--- /dev/null
@@ -0,0 +1,24 @@
+package org.tizen.injector.telephony.sms.encription;
+
+public class SMS_USERDATA {
+       public SMS_USERDATA() {
+               smsUDH = new SMS_UDH();
+       }
+       public void setSMSUDH(char type, short ref, char seg, char num)
+       {
+               smsUDH.udhType = type;
+               smsUDH.msgRef = ref;
+               smsUDH.totalSeg = seg;
+               smsUDH.seqNum = num;
+       }
+       public int headerCnt;
+       public SMS_UDH smsUDH;
+       public int length;
+       public byte[] data;
+}
+class SMS_UDH {
+       public char udhType;
+       public short msgRef;
+       public char totalSeg;
+       public char seqNum;
+}
\ No newline at end of file
diff --git a/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/SmsAddressInfo.java b/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/SmsAddressInfo.java
new file mode 100644 (file)
index 0000000..59dce7b
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * org.tizen.injector.telephony.sms
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.sms.encription;
+
+public class SmsAddressInfo {
+       public int ton;         // NumberType
+        public int npi;                // NumberingPlan
+        public int dialnumlen; // UINT32
+        public char diallingNum[] = new char[21];  // unsigned char
+}
diff --git a/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/TPDU_SMS_DELIVER.java b/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/TPDU_SMS_DELIVER.java
new file mode 100644 (file)
index 0000000..9193821
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * org.tizen.injector.telephony.sms
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.sms.encription;
+
+public class TPDU_SMS_DELIVER {
+       public int msgType;    // SmsTPDUType
+       public boolean mms;     // BOOL
+       public boolean rp;      // BOOL
+       public boolean udhi;    // BOOL
+       public boolean sri;     // BOOL
+       public boolean ported;    // weather use port addressing
+       
+       public SmsAddressInfo orgAddr;
+       public byte pId;         // BYTE
+       public TmDateTime scts;
+       public TapiNetTextCodingScheme dcs;
+       public int udl;    // UINT
+       public short port;    // port addressing value
+       //public char[] userData; // byte *
+       public SMS_USERDATA userData;
+       public TPDU_SMS_DELIVER() {
+               orgAddr = new SmsAddressInfo();
+               scts = new TmDateTime();
+               dcs = new TapiNetTextCodingScheme();
+       }
+}
diff --git a/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/TPDU_SMS_SUBMIT.java b/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/TPDU_SMS_SUBMIT.java
new file mode 100644 (file)
index 0000000..ecd3ace
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * org.tizen.injector.telephony.sms
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.sms.encription;
+
+public class TPDU_SMS_SUBMIT {
+       // message type
+       int msgType;  // SmsTPDUType bit 0,1
+       
+       // reject duplicates
+       boolean rd;  // bit 2
+       
+       // validity period format
+       int vpf; // TapiNetTextVPType bits 3,4
+       
+       // reply path
+       boolean rp;  // bit 7
+       
+       // user data header indication
+       boolean udhi;  // bit 6
+       
+       // status report request
+       boolean srr;  // bit 5
+       
+       /******  BODY *******/
+       //message reference
+       int mr;
+       
+       // destination address
+       public SmsAddressInfo destAddr;
+       
+       // protocol identifier
+       char pId;
+       
+       //data coding scheme
+       TapiNetTextCodingScheme dcs;
+       
+       // validity period
+       TapiNetTextVP vp;
+       
+       // user data length
+       public int udl;
+       
+       // user data
+       public char[] userData;
+       
+       public TPDU_SMS_SUBMIT() {
+               dcs = new TapiNetTextCodingScheme();
+               destAddr = new SmsAddressInfo();
+               vp = new TapiNetTextVP();
+       }
+}
diff --git a/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/TapiNetTextCodingScheme.java b/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/TapiNetTextCodingScheme.java
new file mode 100644 (file)
index 0000000..4a8605e
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * org.tizen.injector.telephony.sms
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.sms.encription;
+
+public class TapiNetTextCodingScheme {
+       public boolean bSMSCinSIM;              /**< if SMSC is stored in SIM this is TRUE */
+       public boolean bCompressed;             /**< if text is compressed this is TRUE */
+       public boolean bMsgClassSet;    /**< message class indication. if TRUE = bits 1..0, if FALSE = reserved */
+       public boolean bMsgIndActive;   /**< message indication group. if TRUE = on, FALSE = off */
+       public int codingGroupType;  // TapiNetTextCodingGroupType
+       public int waitingType;      // TapiNetTextWaitingType
+       public int alphabetType;     // TapiNetTextAlphabetType
+       public int classType;        // TapiNetTextClassType
+       public byte codingGroup;
+       public byte code;
+}
diff --git a/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/TapiNetTextVP.java b/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/TapiNetTextVP.java
new file mode 100644 (file)
index 0000000..1acdba1
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * org.tizen.injector.telephony.sms
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.sms.encription;
+
+public class TapiNetTextVP {
+       int vpType;  // TapiNetTextVPType
+       int vpRelativeType; // TapiNetVPRelValue
+       long vpValue;  // UINT32
+}
diff --git a/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/TmDateTime.java b/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/TmDateTime.java
new file mode 100644 (file)
index 0000000..2b9984a
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * org.tizen.injector.telephony.sms
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.sms.encription;
+
+public class TmDateTime {
+       public int year;
+       public int month;
+       public int day;
+       public int hour;
+       public int minute;
+       public int second;
+}
diff --git a/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/messages.properties b/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/encription/messages.properties
new file mode 100644 (file)
index 0000000..85ef492
--- /dev/null
@@ -0,0 +1,2 @@
+EncodeMsg_0=Unknown alphabetType UCS2\!\n
+EncodeMsg_1=Unknown alphabetType\!\n
diff --git a/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/messages.properties b/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/messages.properties
new file mode 100644 (file)
index 0000000..d8ec91c
--- /dev/null
@@ -0,0 +1 @@
+TelephonySMS_0=Message
diff --git a/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/page/CellBroadcasting.java b/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/page/CellBroadcasting.java
new file mode 100644 (file)
index 0000000..1b0cc68
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * org.tizen.injector.telephony.sms
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.sms.page;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+
+import org.tizen.injector.provider.AbstractInjectorItem;
+import org.tizen.injector.provider.AbstractInjectorPage;
+
+public class CellBroadcasting extends AbstractInjectorPage{
+       
+       public CellBroadcasting(AbstractInjectorItem item, String name) {
+               super(item, name);
+       }
+
+//     private final static String PAGE_ID = "org.tizen.injector.telephony.sms.cellbroadcasting";
+//     private final static String TITLE = "Cell Broadcasting";
+       
+       private final String[] CHANNEL_ID_LIST = {
+                       Messages.CellBroadcasting_0, Messages.CellBroadcasting_1
+       };
+       private final String[] LANGUAGE_LIST = {
+                       Messages.CellBroadcasting_2, Messages.CellBroadcasting_3
+       };
+       private final String[] GEOGRAPHICAL_LIST = {
+                       "00","01","02","03" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+       };
+       
+       private Combo cmbChannelId, cmbLanguage, cmbGeographical;
+       private Text txtMessageIdentifier, txtDCS, txtUpdateNumber, txtPageNumber, txtMessage;
+       private Button butSend;
+
+       protected void createContents() {
+               createCellBroadcastingSection();
+       }
+       
+       protected void registerReceivers() {
+       }
+
+       private void createCellBroadcastingSection() {
+               Composite client = formUtil.createSection(parent, Messages.CellBroadcasting_8);
+
+               Composite compChannelId = formUtil.createExpandable(client,Messages.CellBroadcasting_9,3);
+               cmbChannelId = formUtil.createCombo(compChannelId);
+               formUtil.addComboItem(cmbChannelId, CHANNEL_ID_LIST);
+               formUtil.createLabel(compChannelId, Messages.CellBroadcasting_10);
+               txtMessageIdentifier = formUtil.createText(compChannelId, ""); //$NON-NLS-1$
+               
+               Composite compLanguage = formUtil.createExpandable(client,Messages.CellBroadcasting_12,3);
+               cmbLanguage = formUtil.createCombo(compLanguage);
+               formUtil.addComboItem(cmbLanguage, LANGUAGE_LIST);
+               formUtil.createLabel(compLanguage, Messages.CellBroadcasting_13);
+               txtDCS = formUtil.createText(compLanguage, ""); //$NON-NLS-1$
+               
+               Composite compSerialNumber = formUtil.createExpandable(client,Messages.CellBroadcasting_15,4);
+               formUtil.createLabel(compSerialNumber, Messages.CellBroadcasting_16);
+               cmbGeographical = formUtil.createCombo(compSerialNumber);
+               formUtil.addComboItem(cmbGeographical, GEOGRAPHICAL_LIST);
+               formUtil.createLabel(compSerialNumber, Messages.CellBroadcasting_17);
+               txtUpdateNumber = formUtil.createText(compSerialNumber, ""); //$NON-NLS-1$
+               
+               Composite compPageNumber = formUtil.createExpandable(client,Messages.CellBroadcasting_19,2);
+               formUtil.createLabel(compPageNumber, Messages.CellBroadcasting_20);
+               txtPageNumber = formUtil.createText(compPageNumber, ""); //$NON-NLS-1$
+               
+               Composite compMessage = formUtil.createExpandable(client,Messages.CellBroadcasting_22);
+               txtMessage = formUtil.createText(compMessage, ""); //$NON-NLS-1$
+               formUtil.setWidth(txtMessage, 350);
+               
+               Composite buttonComposite = formUtil.createComposite(client);
+               butSend = formUtil.createButton(buttonComposite, Messages.CellBroadcasting_24, SWT.PUSH);
+               butSend.addSelectionListener( new SelectionAdapter(){
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               super.widgetSelected(e);
+                       }
+               });             
+       }
+
+
+       
+               
+}
diff --git a/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/page/Messages.java b/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/page/Messages.java
new file mode 100644 (file)
index 0000000..2ca9ae1
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * org.tizen.injector.telephony.sms
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.sms.page;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+       private static final String BUNDLE_NAME = "org.tizen.injector.telephony.sms.page.messages"; //$NON-NLS-1$
+       public static String CellBroadcasting_0;
+       public static String CellBroadcasting_1;
+       public static String CellBroadcasting_10;
+       public static String CellBroadcasting_12;
+       public static String CellBroadcasting_13;
+       public static String CellBroadcasting_15;
+       public static String CellBroadcasting_16;
+       public static String CellBroadcasting_17;
+       public static String CellBroadcasting_19;
+       public static String CellBroadcasting_2;
+       public static String CellBroadcasting_20;
+       public static String CellBroadcasting_22;
+       public static String CellBroadcasting_24;
+       public static String CellBroadcasting_3;
+       public static String CellBroadcasting_8;
+       public static String CellBroadcasting_9;
+       public static String SMS_0;
+       public static String SMS_1;
+       public static String SMS_10;
+       public static String SMS_11;
+       public static String SMS_12;
+       public static String SMS_13;
+       public static String SMS_14;
+       public static String SMS_15;
+       public static String SMS_16;
+       public static String SMS_17;
+       public static String SMS_18;
+       public static String SMS_19;
+       public static String SMS_2;
+       public static String SMS_20;
+       public static String SMS_21;
+       public static String SMS_22;
+       public static String SMS_23;
+       public static String SMS_24;
+       public static String SMS_25;
+       public static String SMS_26;
+       public static String SMS_27;
+       public static String SMS_28;
+       public static String SMS_29;
+       public static String SMS_3;
+       public static String SMS_31;
+       public static String SMS_35;
+       public static String SMS_37;
+       public static String SMS_38;
+       public static String SMS_39;
+       public static String SMS_4;
+       public static String SMS_5;
+       public static String SMS_6;
+       public static String SMS_7;
+       public static String SMS_8;
+       public static String SMS_9;
+       public static String MMS_0;
+       public static String MMS_1;
+       static {
+               // initialize resource bundle
+               NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+       }
+
+       private Messages() {
+       }
+}
diff --git a/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/page/SMS.java b/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/page/SMS.java
new file mode 100644 (file)
index 0000000..208935b
--- /dev/null
@@ -0,0 +1,788 @@
+/*
+ * org.tizen.injector.telephony.sms
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.sms.page;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.lang.reflect.InvocationTargetException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.tizen.common.connection.ConnectionPlugin;
+import org.tizen.common.connection.ConnectionPlugin.ISelectionListener;
+import org.tizen.injector.InjectorDialog;
+import org.tizen.injector.protocol.AbstractGA;
+import org.tizen.injector.protocol.StructureGA;
+import org.tizen.injector.provider.AbstractInjectorItem;
+import org.tizen.injector.provider.AbstractInjectorPage;
+import org.tizen.injector.receiver.AbstractInjectorReceiver;
+import org.tizen.injector.socket.TelephonySocket;
+import org.tizen.injector.telephony.call.TelephonyCall;
+import org.tizen.injector.telephony.sms.encription.DecodeMsg;
+import org.tizen.injector.telephony.sms.encription.EncodeMsg;
+import org.tizen.injector.telephony.sms.encription.EnumConstants;
+import org.tizen.injector.telephony.sms.encription.SMS_USERDATA;
+import org.tizen.injector.telephony.sms.encription.SmsAddressInfo;
+import org.tizen.injector.telephony.sms.encription.TPDU_SMS_DELIVER;
+import org.tizen.injector.telephony.sms.encription.TPDU_SMS_SUBMIT;
+import org.tizen.injector.telephony.sms.encription.TapiNetTextCodingScheme;
+import org.tizen.injector.telephony.sms.encription.TmDateTime;
+import org.tizen.injector.telephony.sms.protocol.G04A01;
+import org.tizen.injector.telephony.sms.protocol.G04A05;
+import org.tizen.injector.view.InjectorView;
+import org.tizen.sdblib.IDevice;
+import org.tizen.sdblib.service.FileEntry;
+
+public class SMS extends AbstractInjectorPage implements
+ISelectionListener{
+       public SMS(AbstractInjectorItem item, String name) {
+               super(item, name);
+       }
+
+       private final String[] SENDING_STATUS_VALUE_SMS = { Messages.SMS_0,
+                       Messages.SMS_2 };
+       private final String[] SENDING_STATUS_VALUE_MMS = { Messages.MMS_0,
+                       Messages.MMS_1 };
+       private final String[] USE_SMSC_LIST = { "+821091111" }; //$NON-NLS-1$
+       private final char[] SMSC_NUM = {+8, 2, 1, 0, 9, 1, 1, 1, 1};
+       private final String[] ORIGINATING_ADDRESS_LIST = { "+821030014180" }; //$NON-NLS-1$
+       private final String[] CLASS_TYPE_LIST = { Messages.SMS_11, Messages.SMS_12,
+                       Messages.SMS_15, Messages.SMS_16, Messages.SMS_17 };
+
+       private Combo cmbSentStatusSendingStatus, cmbSentStatusMMSSendingStatus;
+       private Button butSentStatusSet;
+
+       private Combo cmbMobileTerminateUseSMSC,
+                       cmbMobileTerminateOriginatingAddress, cmbMobileTerminateClassType;
+       private Button butMobileTerminateSMSCconfigured, butMobileTerminateSendMsg,
+                       butMobileTerminatePort;
+       private Text txtMobileTerminatePID, txtMobileTerminateDCS,
+                       txtMobileTerminateMessageText, txtMobileTerminateReceivedMessage,
+                       txtMobileTerminatePort;
+       private Label lblMobileTerminateMessageLength,
+                       lblMobileTerminateReceivedMessage, lblMobileTerminateReceivedNumber, 
+                       txtMobileTerminateReceivedNumber, lblMobileTerminatePortBlank;
+       private IDevice currentDevice;
+       
+       public boolean isMsgReceived = false;
+       public int sleepCnt = 0;
+       
+       protected void createContents() {
+               InjectorView.getDefault().addSelectionListener(this);
+               currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
+               createSendSection();
+               createReceiveSection();
+               createMMSSection();
+       }
+
+       protected void registerReceivers() {
+               registerReceiver(new SimDBReceiver());
+       }
+
+       protected int get_error_code_from_ui_index(int index) {
+               if (index <= 17)
+                       return index;
+               switch (index) {
+               case 18:
+                       return 0x8001;
+               case 19:
+                       return 0x8008;
+               case 20:
+                       return 0x800A;
+               case 21:
+                       return 0x8015;
+               case 22:
+                       return 0x8016;
+               case 23:
+                       return 0x801B;
+               case 24:
+                       return 0x801C;
+               case 25:
+                       return 0x801D;
+               case 26:
+                       return 0x801E;
+               case 27:
+                       return 0x8026;
+               case 28:
+                       return 0x8029;
+               case 29:
+                       return 0x802A;
+               case 30:
+                       return 0x802F;
+               case 31:
+                       return 0x8032;
+               case 32:
+                       return 0x8045;
+               case 33:
+                       return 0x8051;
+               case 34:
+                       return 0x8060;
+               case 35:
+                       return 0x8061;
+               case 36:
+                       return 0x8062;
+               case 37:
+                       return 0x8063;
+               case 38:
+                       return 0x806F;
+               case 39:
+                       return 0x807F;
+               case 40:
+                       return 0x8111;
+               case 41:
+                       return 0x8126;
+               case 42:
+                       return 0x812C;
+               default:
+                       return 0x0000;
+               }
+       }
+
+       private void createSendSection() {
+               Composite client = formUtil.createSection(parent, Messages.SMS_23);
+               Composite compAddressSelector = formUtil.createExpandable(client,
+                               Messages.SMS_24, 3);
+               GridData gd = new GridData(GridData.FILL, GridData.FILL, false, true);
+               gd.widthHint = 560;
+               compAddressSelector.setLayoutData(gd);
+               formUtil.createLabel(compAddressSelector,
+                               Messages.SMS_27);
+               cmbMobileTerminateOriginatingAddress = formUtil.createEditableCombo(
+                               compAddressSelector, 2);
+               formUtil.addComboItem(cmbMobileTerminateOriginatingAddress,
+                               ORIGINATING_ADDRESS_LIST);
+               Composite compUserData = formUtil.createExpandable(client,
+                               Messages.SMS_13, 3);
+               formUtil.createLabel(compUserData, Messages.SMS_35);
+               txtMobileTerminateMessageText = formUtil.createText(compUserData, ""); //$NON-NLS-1$
+               txtMobileTerminateMessageText.setTextLimit(80);
+               formUtil.setWidth(txtMobileTerminateMessageText, 354);
+
+               butMobileTerminateSendMsg = formUtil.createButton(compUserData,
+                               Messages.SMS_37, SWT.PUSH);
+               gd = new GridData(GridData.FILL, GridData.FILL, false, true);
+               gd.widthHint = 100;
+               butMobileTerminateSendMsg.setLayoutData(gd);
+               
+               butMobileTerminateSendMsg.addSelectionListener(new SelectionAdapter() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               sendMsg(butMobileTerminatePort.getSelection());
+                       }
+               });
+               formUtil.createLabel(compUserData, "");
+               Composite compPort = formUtil.createComposite(compUserData, 3);
+               lblMobileTerminatePortBlank = formUtil.createLabel(compPort, "");
+               gd = new GridData(GridData.FILL, GridData.FILL, false, true);
+               gd.widthHint = 255;
+               lblMobileTerminatePortBlank.setLayoutData(gd);
+               butMobileTerminatePort = formUtil.createButton(compPort, Messages.SMS_39, SWT.CHECK);
+               butMobileTerminatePort.addSelectionListener(new SelectionAdapter() {
+                       public void widgetSelected(SelectionEvent e) {
+                               if (butMobileTerminatePort.getSelection() == true){
+                                       txtMobileTerminatePort.setEnabled(true);
+                               }else{
+                                       txtMobileTerminatePort.setEnabled(false);
+                               }
+                       }
+               });
+               txtMobileTerminatePort = formUtil.createText(compPort, "");
+               txtMobileTerminatePort.setTextLimit(5);
+               gd = new GridData(GridData.FILL, GridData.FILL, false, true);
+               gd.widthHint = 40;
+               txtMobileTerminatePort.setLayoutData(gd);
+               txtMobileTerminatePort.setEnabled(false);
+               txtMobileTerminatePort.addKeyListener(new KeyListener() {
+                       public void keyReleased(KeyEvent e) {
+                               if (e.character == '-'){
+                                       showDialog("You cannot use minus value.");
+                                       txtMobileTerminatePort.setText("");
+                                       return;
+                               }
+                               try{
+                                       if (Integer.parseInt(txtMobileTerminatePort.getText()) > 65535){
+                                               showDialog("Port range : 0~65535");
+                                               txtMobileTerminatePort.setText("");
+                                               return ;
+                                       }
+                               }catch(NumberFormatException ne){
+                                       if(!txtMobileTerminatePort.getText().equals("")){
+                                               showDialog("Please input only number");
+                                               txtMobileTerminatePort.setText("");
+                                               return ;
+                                       }
+                               }
+                       }
+                       public void keyPressed(KeyEvent e) {
+                       }
+               });
+       }
+
+       private void createReceiveSection() {
+               Composite client = formUtil.createSection(parent, Messages.SMS_18);
+
+               GridData gd = new GridData(GridData.FILL, GridData.FILL, false, true);
+               gd.widthHint = 560;
+               client.setLayoutData(gd);
+               Composite mainComposite = formUtil.createExpandable(client, Messages.SMS_31, 3);
+
+               formUtil.createLabel(mainComposite, Messages.SMS_19);
+               cmbSentStatusSendingStatus = formUtil.createCombo(mainComposite);
+               gd = new GridData(GridData.FILL, GridData.FILL, false, true);
+               gd.widthHint = 312;
+               cmbSentStatusSendingStatus.setLayoutData(gd);
+               formUtil.addComboItem(cmbSentStatusSendingStatus,
+                               SENDING_STATUS_VALUE_SMS);
+
+               butSentStatusSet = formUtil
+                               .createButton(mainComposite, Messages.SMS_20, SWT.PUSH);
+               gd = new GridData(GridData.FILL, GridData.FILL, false, true);
+               gd.widthHint = 100;
+               butSentStatusSet.setLayoutData(gd);
+               butSentStatusSet.addSelectionListener(new SelectionAdapter() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               sendstatus();
+                       }
+               });
+
+               Composite compReceivedMessage = formUtil.createExpandable(client,
+                               Messages.SMS_38, 2);
+               lblMobileTerminateReceivedNumber = formUtil.createLabel(
+                               compReceivedMessage, "Call Number : "); //$NON-NLS-1$
+               txtMobileTerminateReceivedNumber = formUtil.createLabel(compReceivedMessage, ""); //$NON-NLS-1$
+               formUtil.setWidth(txtMobileTerminateReceivedNumber, 350);
+               lblMobileTerminateReceivedMessage = formUtil.createLabel(
+                               compReceivedMessage, "Message     : \n\n\n\n\n"); //$NON-NLS-1$
+               txtMobileTerminateReceivedMessage = formUtil.createTextArea(compReceivedMessage, "\n\n\n\n\n");
+       }
+
+       private void createMMSSection() {
+               Composite client = formUtil.createSection(parent, Messages.SMS_22);
+
+               GridData gd = new GridData(GridData.FILL, GridData.FILL, false, true);
+               gd.widthHint = 560;
+               client.setLayoutData(gd);
+               Composite mainComposite = formUtil.createComposite(client, 3);
+
+               formUtil.createLabel(mainComposite, Messages.SMS_19);
+               cmbSentStatusMMSSendingStatus = formUtil.createCombo(mainComposite);
+               gd = new GridData(GridData.FILL, GridData.FILL, false, true);
+               gd.widthHint = 312;
+               cmbSentStatusMMSSendingStatus.setLayoutData(gd);
+               formUtil.addComboItem(cmbSentStatusMMSSendingStatus,
+                               SENDING_STATUS_VALUE_MMS);
+
+               butSentStatusSet = formUtil
+                               .createButton(mainComposite, Messages.SMS_20, SWT.PUSH);
+               gd = new GridData(GridData.FILL, GridData.FILL, false, true);
+               gd.widthHint = 100;
+               butSentStatusSet.setLayoutData(gd);
+               butSentStatusSet.addSelectionListener(new SelectionAdapter() {
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               sendstatusMMS();
+                       }
+               });
+       }
+
+       protected void sendstatus() {
+               int errorcode = get_error_code_from_ui_index(cmbSentStatusSendingStatus
+                               .getSelectionIndex());
+               int data1 = errorcode & 0x00ff;
+               int data2 = (errorcode >> 8) & 0x00ff;
+
+               G04A05 ga = new G04A05();
+               ga.intialize();
+               StructureGA sga = ga.getBody();
+               sga.setInt("DATA1", data1); //$NON-NLS-1$
+               sga.setInt("DATA2", data2); //$NON-NLS-1$
+
+               try {
+                       injectorSocket.send(ga);
+               } catch (IOException e) {
+                       e.printStackTrace();
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+
+       protected void sendstatusMMS() {
+               int errorcode = get_error_code_from_ui_index(cmbSentStatusMMSSendingStatus
+                               .getSelectionIndex());
+               int data1 = (errorcode+10) & 0x00ff;
+               int data2 = ((errorcode+10) >> 8) & 0x00ff;
+
+               G04A05 ga = new G04A05();
+               ga.intialize();
+               StructureGA sga = ga.getBody();
+               sga.setInt("DATA1", data1); //$NON-NLS-1$
+               sga.setInt("DATA2", data2); //$NON-NLS-1$
+
+               try {
+                       injectorSocket.send(ga);
+               } catch (IOException e) {
+                       e.printStackTrace();
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+
+       public void showDialog(String msg)
+       {
+               Shell shell = parent.getShell();
+               InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, msg);
+       }
+       
+       protected void sendMsg(Boolean ported) {
+               if(ported){
+                       if(txtMobileTerminatePort.getText().equals("")){
+                               showDialog("Please input the port value");
+                               txtMobileTerminatePort.setFocus();
+                               return ;
+                       }
+               }
+               if(!TelephonyCall.getinstance().getRssiStatus())
+               {
+                       showDialog("RSSI level is zero.\nPlease try again later.");
+                       return;
+               }
+               
+               // check number
+               String number = cmbMobileTerminateOriginatingAddress.getText().trim();
+               {
+                       if(number==null||number.length()==0) {
+                               Shell shell = parent.getShell();
+                               InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "Input phone number.");
+                               return;
+                       }
+                       if(number.length() > 15) {
+                               Shell shell = parent.getShell();
+                               InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "The maximum length of phone number is 15.");
+                               return;
+                       }
+                       if(checkNumberFormat(number)) {
+                               Shell shell = parent.getShell();
+                               InjectorDialog.openInfoDialog(shell, InjectorDialog.TITLE, "This is invalid number. (" + number + ")");
+                                       return;
+                       }
+               }
+
+               char[] packet = new char[500];
+               int pid = 0;
+               int dcs = 0xF0;
+
+               EncodeMsg encode = new EncodeMsg();
+
+               SmsAddressInfo SCA = new SmsAddressInfo();
+               SCA.diallingNum = SMSC_NUM;
+               SCA.dialnumlen = SCA.diallingNum.length;
+
+               Date currentDate = new Date();
+
+               SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy"); //$NON-NLS-1$
+               String year = dateFormat.format(currentDate);
+               dateFormat = new SimpleDateFormat("MM"); //$NON-NLS-1$
+               String month = dateFormat.format(currentDate);
+               dateFormat = new SimpleDateFormat("dd"); //$NON-NLS-1$
+               String day = dateFormat.format(currentDate);
+               dateFormat = new SimpleDateFormat("HH"); //$NON-NLS-1$
+               String hour = dateFormat.format(currentDate);
+               dateFormat = new SimpleDateFormat("mm"); //$NON-NLS-1$
+               String minute = dateFormat.format(currentDate);
+               dateFormat = new SimpleDateFormat("ss"); //$NON-NLS-1$
+               String second = dateFormat.format(currentDate);
+               
+               TmDateTime tm = new TmDateTime();
+               tm.year = Integer.parseInt(year.trim());
+               tm.month = Integer.parseInt(month.trim());
+               tm.day = Integer.parseInt(day.trim());
+               tm.hour = Integer.parseInt(hour.trim());
+               tm.minute = Integer.parseInt(minute.trim());
+               tm.second = Integer.parseInt(second.trim());
+
+               TapiNetTextCodingScheme scheme = new TapiNetTextCodingScheme();
+               scheme.bCompressed = false;
+               scheme.bMsgClassSet = false;
+               scheme.bMsgIndActive = false;
+               scheme.codingGroupType = EnumConstants.TAPI_NETTEXT_CODGRP_SM_GENERAL_DCS;
+               scheme.waitingType = EnumConstants.TAPI_NETTEXT_WAITING_VOICE_MSG;
+               scheme.alphabetType = EnumConstants.TAPI_NETTEXT_ALPHABET_UCS2;
+//             scheme.alphabetType = EnumConstants.TAPI_NETTEXT_ALPHABET_8BIT;
+//             scheme.classType = cmbMobileTerminateClassType.getSelectionIndex();
+               scheme.classType = 0;
+               scheme.codingGroup = 0;
+               scheme.code = 0;
+
+               TPDU_SMS_DELIVER tpdu_deliver = new TPDU_SMS_DELIVER();
+               tpdu_deliver.msgType = 0;
+               tpdu_deliver.mms = false;
+               tpdu_deliver.rp = false;
+               tpdu_deliver.udhi = false;
+               tpdu_deliver.sri = false;
+               if (ported){
+                       tpdu_deliver.ported = ported;
+                       tpdu_deliver.port = Short.parseShort(txtMobileTerminatePort.getText());
+               } else {
+                       tpdu_deliver.ported = false;
+                       tpdu_deliver.port = -1;
+               }
+
+               SmsAddressInfo orgAddr = new SmsAddressInfo();
+               orgAddr.diallingNum = number.toCharArray();
+               orgAddr.dialnumlen = orgAddr.diallingNum.length;
+
+               tpdu_deliver.orgAddr = orgAddr;
+               tpdu_deliver.pId = 0;
+               tpdu_deliver.scts = tm;
+               tpdu_deliver.dcs = scheme;
+               tpdu_deliver.udl = 0;
+
+               ArrayList<SMS_USERDATA> dataArray = getUserData(txtMobileTerminateMessageText.getText());
+               if (dataArray.size() > 1 || tpdu_deliver.ported) {
+                       tpdu_deliver.udhi = true;
+               }
+
+               for (SMS_USERDATA userData : dataArray) {
+                       tpdu_deliver.userData = userData;
+                       int packet_len = encode.EncodeSmsDeliverTpdu(SCA, tpdu_deliver, packet,
+                                       pid, dcs);
+                       final byte[] data = convertToByte(packet, packet_len);
+
+                       G04A01 ga = new G04A01() {
+                               protected void makeBody() {
+                                       StructureGA ga = getBody();
+                                       ga.addByteArrayItem("DATA", data.length); //$NON-NLS-1$
+                               }
+                       };
+                       ga.intialize();
+
+                       StructureGA sga = ga.getBody();
+                       sga.setByteArray("DATA", data); //$NON-NLS-1$
+
+                       try {
+                               injectorSocket.send(ga);
+                       } catch (IOException e) {
+                               e.printStackTrace();
+                       } catch (Exception e) {
+                               e.printStackTrace();
+                       }
+               }
+               
+               try {
+                       new ProgressMonitorDialog(parent.getShell()).run(true, false,
+                                       new IRunnableWithProgress() {
+                                               public void run(IProgressMonitor monitor)
+                                                               throws InvocationTargetException,
+                                                               InterruptedException {
+                                                       sleepCnt = 0;
+                                                       while(true)
+                                                       {                               
+                                                               if(sleepCnt > 100)      // elapsed 10 sec
+                                                                       break;
+                                                               
+                                                               isMsgReceived = TelephonySocket.getInstance().getMsgReceived();
+                                                               if(isMsgReceived)
+                                                                       break;
+                                                               
+                                                               Thread.sleep(100);      // 1/10 sec
+                                                               sleepCnt++;
+                                                       }
+                                                       TelephonySocket.getInstance().setMsgReceived(false);
+                                                       isMsgReceived = false;
+                                       }
+                       });
+               } catch (InterruptedException e) {
+                       e.printStackTrace();
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+               
+               /* comment out because this doesn't be used now. 20130528
+               if(sleepCnt > 100)
+                       showDialog("Message transmission failed.");
+               */
+       }
+
+       private static boolean checkNumberFormat(String noStr) {
+               Pattern tellPattern = Pattern.compile( "[^0-9++]");
+               Matcher matcher = tellPattern.matcher(noStr);
+               return matcher.find();
+       }
+
+       private ArrayList<SMS_USERDATA> getUserData(String message) {
+               ArrayList<SMS_USERDATA> list = new ArrayList<SMS_USERDATA>();
+               int length = 60; //temp length
+               int count = message.length() / length; 
+               count = count + 1;
+               int index = 0;
+               SMS_USERDATA userData;
+
+               for (int i = 0; i < count; i++) {
+                       userData = new SMS_USERDATA();
+                       try {
+                               int len = index+length > (message.length() - index) ? (message.length() - index)
+                                                 : index + length;
+                               userData.data = message.substring(index, index + len).getBytes("ISO-10646-UCS-2");
+                               userData.length = userData.data.length;
+                               userData.headerCnt = 1;
+                               userData.setSMSUDH((char)0x00, (short)0x0000, (char)count, (char)(i+1));
+                       } catch (UnsupportedEncodingException e) {
+                               e.printStackTrace();
+                               continue;
+                       }
+                       if (count == 1) {
+                               userData.headerCnt = 0;
+                       }
+                       list.add(userData);
+                       index = index + length;
+               }
+               return list;
+       }
+
+       private byte[] convertToByte(char[] buf, int length) {
+               byte[] result = new byte[length];
+               for (int i = 0; i < length; i++) {
+                       result[i] = (byte) buf[i];
+               }
+               return result;
+       }
+
+       // 1000 -> 1초
+               public void MatrixTime(int delayTime)
+               {
+                   long saveTime = System.currentTimeMillis();
+                   long currTime = 0;
+
+                   while( currTime - saveTime < delayTime)
+                   {
+                       currTime = System.currentTimeMillis();
+                   }
+               }
+
+               public void sendDeliveryReport()
+               {
+                       char[] packet = new char[500];
+                       int pid = 0;
+                       int dcs = 0xF0;
+
+                       EncodeMsg encode = new EncodeMsg();
+
+                       SmsAddressInfo SCA = new SmsAddressInfo();
+                       SCA.diallingNum = SMSC_NUM;
+                       SCA.dialnumlen = SCA.diallingNum.length;
+
+                       Date currentDate = new Date();
+
+                       SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy"); //$NON-NLS-1$
+                       String year = dateFormat.format(currentDate);
+                       dateFormat = new SimpleDateFormat("MM"); //$NON-NLS-1$
+                       String month = dateFormat.format(currentDate);
+                       dateFormat = new SimpleDateFormat("dd"); //$NON-NLS-1$
+                       String day = dateFormat.format(currentDate);
+                       dateFormat = new SimpleDateFormat("HH"); //$NON-NLS-1$
+                       String hour = dateFormat.format(currentDate);
+                       dateFormat = new SimpleDateFormat("mm"); //$NON-NLS-1$
+                       String minute = dateFormat.format(currentDate);
+                       dateFormat = new SimpleDateFormat("ss"); //$NON-NLS-1$
+                       String second = dateFormat.format(currentDate);
+                       
+                       TmDateTime tm = new TmDateTime();
+                       tm.year = Integer.parseInt(year.trim());
+                       tm.month = Integer.parseInt(month.trim());
+                       tm.day = Integer.parseInt(day.trim());
+                       tm.hour = Integer.parseInt(hour.trim());
+                       tm.minute = Integer.parseInt(minute.trim());
+                       tm.second = Integer.parseInt(second.trim());
+
+                       TapiNetTextCodingScheme scheme = new TapiNetTextCodingScheme();
+                       scheme.bCompressed = false;
+                       scheme.bMsgClassSet = false;
+                       scheme.bMsgIndActive = false;
+                       scheme.codingGroupType = EnumConstants.TAPI_NETTEXT_CODGRP_SM_GENERAL_DCS;
+                       scheme.waitingType = EnumConstants.TAPI_NETTEXT_WAITING_VOICE_MSG;
+                       scheme.alphabetType = EnumConstants.TAPI_NETTEXT_ALPHABET_UCS2;
+//                     scheme.alphabetType = EnumConstants.TAPI_NETTEXT_ALPHABET_8BIT;
+//                     scheme.classType = cmbMobileTerminateClassType.getSelectionIndex();
+                       scheme.classType = 0;
+                       scheme.codingGroup = 0;
+                       scheme.code = 0;
+
+                       TPDU_SMS_DELIVER tpdu_deliver = new TPDU_SMS_DELIVER();
+                       tpdu_deliver.msgType = 0;
+                       tpdu_deliver.mms = false;
+                       tpdu_deliver.rp = false;
+                       tpdu_deliver.udhi = false;
+                       tpdu_deliver.sri = false;
+
+                       SmsAddressInfo orgAddr = new SmsAddressInfo();
+                       String dstnum = DecodeMsg.deliveryReportNum_set.iterator().next();
+                       DecodeMsg.deliveryReportNum_set.remove(dstnum);
+                       orgAddr.diallingNum = String.format(dstnum).toCharArray();
+                       
+                       orgAddr.dialnumlen = orgAddr.diallingNum.length;
+
+                       tpdu_deliver.orgAddr = orgAddr;
+                       tpdu_deliver.pId = 0;
+                       tpdu_deliver.scts = tm;
+                       tpdu_deliver.dcs = scheme;
+                       tpdu_deliver.udl = 0;
+                       String msg = "Message delivered.";
+                       SMS_USERDATA userData1 = new SMS_USERDATA();
+                       try {
+                               userData1.data = msg.getBytes("ISO-10646-UCS-2");
+                               userData1.length = userData1.data.length;
+                               userData1.headerCnt = 0;
+                               userData1.setSMSUDH((char)0x00, (short)0x0000, (char)2, (char)1);
+                               tpdu_deliver.userData = userData1;
+                       } catch (UnsupportedEncodingException e1) {
+                               // TODO Auto-generated catch block
+                               e1.printStackTrace();
+                       }
+                       int packet_len = encode.EncodeSmsDeliverTpdu(SCA, tpdu_deliver, packet,
+                                       pid, dcs);
+                       final byte[] data = convertToByte(packet, packet_len);
+
+                       G04A01 ga = new G04A01() {
+                               protected void makeBody() {
+                                       StructureGA ga = getBody();
+                                       ga.addByteArrayItem("DATA", data.length); //$NON-NLS-1$
+                               }
+                       };
+                       ga.intialize();
+
+                       StructureGA sga = ga.getBody();
+                       sga.setByteArray("DATA", data); //$NON-NLS-1$
+
+                       try {
+                               MatrixTime(1200);
+                               injectorSocket.send(ga);
+                       } catch (IOException e) {
+                               e.printStackTrace();
+                       } catch (Exception e) {
+                               e.printStackTrace();
+                       }
+               }
+               
+       public class SimDBReceiver extends AbstractInjectorReceiver {
+               @Override
+               public void run(AbstractGA aga) {
+                       StructureGA sga = aga.getBody();
+
+                       TPDU_SMS_SUBMIT tpdu_submit = new TPDU_SMS_SUBMIT();
+                       byte[] buf = sga.getByteArray("DATA"); //$NON-NLS-1$
+                       char[] rawdata = convertToChar(buf, 3, buf.length - 3); // new
+                                                                                                                                       // change
+                                                                                                                                       // May 6
+                       DecodeMsg decode = new DecodeMsg();
+                       
+                       decode.DecodeSmsSubmitTpdu(tpdu_submit, 500, rawdata);
+
+                       txtMobileTerminateReceivedNumber.setText(String.valueOf(tpdu_submit.destAddr.diallingNum).trim());
+                       if(DecodeMsg.relayedsms)
+                       {
+                               txtMobileTerminateReceivedMessage.setText(String.valueOf(DecodeMsg.smsbuffer).trim());
+                               DecodeMsg.relay_cnt--;
+                               if(DecodeMsg.relay_cnt == 0)
+                               {
+                                       for(int i = 0; i < DecodeMsg.smsbuffer_index; i++)
+                                               DecodeMsg.smsbuffer[i] = '\0';
+                                       
+                                       DecodeMsg.smsbuffer_index = 0;
+                                       DecodeMsg.relayedsms = false;
+                               }
+                       }
+                       else
+                               txtMobileTerminateReceivedMessage.setText(String.valueOf(tpdu_submit.userData).trim());
+                       
+                       if(DecodeMsg.deliveryReport)
+                       {
+                               if(DecodeMsg.relayedsms)
+                               {
+                                       if(tpdu_submit.udl < 255)
+                                               sendDeliveryReport();
+                               }
+                               else
+                                       sendDeliveryReport();
+                       }
+               }
+
+               @Override
+               public AbstractGA createTransferObject() {
+                       return new G04A01();
+               }
+       }
+
+       private char[] convertToChar(byte[] buf, int start, int length) {
+               char[] result = new char[length];
+               int idx = 0;
+               for (int i = 0; i < buf.length; i++) {
+                       if (i >= start) {
+                               result[idx++] = (char) buf[i];
+                               if (idx >= length)
+                                       break;
+                       }
+               }
+               return result;
+       }
+
+       @Override
+       public void selectionChanged(FileEntry selectedEntry) {
+               if( selectedEntry == null) {
+                       return;
+               }
+
+               if(currentDevice != null)
+               {
+                       if (currentDevice.getSerialNumber() != selectedEntry.getName()) {
+                               txtMobileTerminateMessageText.setText("");
+                               txtMobileTerminateReceivedNumber.setText("");
+                               txtMobileTerminateReceivedMessage.setText("");
+                       }
+               }
+               currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
+       }
+}
diff --git a/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/page/messages.properties b/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/page/messages.properties
new file mode 100644 (file)
index 0000000..4279b4f
--- /dev/null
@@ -0,0 +1,53 @@
+CellBroadcasting_0=Weather
+CellBroadcasting_1=Sports
+CellBroadcasting_10=Message Identified : 
+CellBroadcasting_12=Language
+CellBroadcasting_13=DCS : 
+CellBroadcasting_15=Serial Number
+CellBroadcasting_16=Geographical : 
+CellBroadcasting_17=Update Number : 
+CellBroadcasting_19=Page Number
+CellBroadcasting_2=English
+CellBroadcasting_20=Page Number : 
+CellBroadcasting_22=Message
+CellBroadcasting_24=Send
+CellBroadcasting_3=Korean
+CellBroadcasting_8=Cell BroadCasting
+CellBroadcasting_9=Channel ID
+SMS_0=SMS OK(Success)
+SMS_1=Routing Released
+SMS_10=Sim Not Ready
+SMS_11=Class type 0
+SMS_12=Class type 1
+SMS_13=Send Data
+SMS_14=\ [Message] 
+SMS_15=Class type 2
+SMS_16=Class type 3
+SMS_17=User Defined
+SMS_18=Receive SMS Message
+SMS_19=Sending Status Value : 
+SMS_2=SMS Not Available
+SMS_20=Set
+SMS_21=[To] 
+SMS_22=MMS Sent Status
+SMS_23=Send SMS Message
+SMS_24=Address Selector
+SMS_25=Use SMSC : 
+SMS_26=SMSC is configured in MS
+SMS_27=Originating Address : 
+SMS_28=Class Type : 
+SMS_29=User Option
+SMS_3=Rout Not Allowed
+SMS_31=SMS Sent Status
+SMS_35=Message : 
+SMS_37=Send Msg
+SMS_38=Received Message
+SMS_39=Port
+SMS_4=Invalid Parameter
+SMS_5=Device Failure
+SMS_6=Pp Reserved
+SMS_7=Service Reserved
+SMS_8=Invalid Location
+SMS_9=No SIM
+MMS_0=MMS OK(Success)
+MMS_1=MMS Failure
\ No newline at end of file
diff --git a/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/protocol/G04A01.java b/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/protocol/G04A01.java
new file mode 100644 (file)
index 0000000..d50f4fd
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * org.tizen.injector.telephony.sms
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.sms.protocol;
+
+import org.tizen.injector.protocol.AbstractGA;
+import org.tizen.injector.protocol.StructureGA;
+
+public class G04A01 extends AbstractGA{
+
+       public G04A01(){
+               super(0x04, 0x01);
+       }
+
+       @Override
+       protected void makeBody() {
+               StructureGA ga = getBody();
+               ga.addByteArrayItem("DATA",500); //$NON-NLS-1$
+       }
+
+       @Override
+       protected void makeHeader() {
+       }
+}
diff --git a/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/protocol/G04A05.java b/org.tizen.injector.telephony.sms/src/org/tizen/injector/telephony/sms/protocol/G04A05.java
new file mode 100644 (file)
index 0000000..8aec108
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * org.tizen.injector.telephony.sms
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.telephony.sms.protocol;
+
+import org.tizen.injector.protocol.AbstractGA;
+import org.tizen.injector.protocol.StructureGA;
+
+public class G04A05 extends AbstractGA{
+       public G04A05(){
+               super(0x04, 0x05);
+       }
+
+       @Override
+       protected void makeBody() {
+               StructureGA ga = getBody();
+               ga.addByteItem("DATA1"); //$NON-NLS-1$
+               ga.addByteItem("DATA2"); //$NON-NLS-1$
+       }
+
+       @Override
+       protected void makeHeader() {
+       }
+}
index 538a4e3..1790ce0 100644 (file)
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
 Bundle-Name: Tizen Event Injector Injector
 Bundle-SymbolicName: org.tizen.injector;singleton:=true
 Bundle-Version: 1.0.0.qualifier
-Bundle-Vendor: Samsung
+Bundle-Vendor: The Linux Foundation
 Require-Bundle: org.eclipse.ui,
  org.eclipse.core.runtime,
  org.eclipse.ui.ide,
@@ -13,7 +13,10 @@ Require-Bundle: org.eclipse.ui,
  org.eclipse.ui.forms;bundle-version="3.3.103"
 Bundle-ActivationPolicy: lazy
 Bundle-Activator: org.tizen.injector.Injector
-Export-Package: org.tizen.injector.protocol,
+Export-Package: org.tizen.injector.control,
+ org.tizen.injector,
+ org.tizen.injector.model,
+ org.tizen.injector.protocol,
  org.tizen.injector.protocol.sensor,
  org.tizen.injector.provider,
  org.tizen.injector.receiver,
@@ -22,4 +25,7 @@ Export-Package: org.tizen.injector.protocol,
  org.tizen.injector.view
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Import-Package: org.tizen.common.connection,
- org.tizen.common.util
+ org.tizen.common.util,
+ org.tizen.sdblib,
+ org.tizen.sdblib.service,
+ org.tizen.sdblib.util
index 2f36167..34c90a1 100644 (file)
@@ -20,7 +20,8 @@
                        id="org.tizen.injector.ViewCategory"/>\r
       <view\r
             category="org.tizen.nativeapp.viewCategory"\r
-            class="org.tizen.injector.view.InjectorView"    \r
+            class="org.tizen.injector.view.InjectorView"\r
+            icon="icons/injector_view.png"\r
             id="org.tizen.injector.view.InjectorView"\r
             name="%view.name"/>\r
 </extension>\r
index 3356c77..8ff6229 100644 (file)
@@ -4,9 +4,9 @@
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index c3b0497..7daf46c 100644 (file)
@@ -4,9 +4,9 @@
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/org.tizen.injector/src/org/tizen/injector/InjectorDialog.java b/org.tizen.injector/src/org/tizen/injector/InjectorDialog.java
new file mode 100644 (file)
index 0000000..ec60a09
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * org.tizen.injector.nfc.tag.page
+ *
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jihye kim <jihye1128.kim@samsung.com>
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * Yeongkyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ */
+
+package org.tizen.injector;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
+
+public abstract class InjectorDialog
+{
+       public static String TITLE = "Event Injector";
+       
+    public static void openInfoDialog(String message) {
+       openInfoDialog(new Shell(), message);
+    }
+
+    public static void openInfoDialog(final Shell shell, final String message) {
+       Shell s;
+       if (shell == null) {
+               s = new Shell();
+       } else {
+               s = shell;
+       }
+       openInfoDialog(s, "Info", message);
+    }
+
+    public static void openInfoDialog(final Shell shell, final String title, final String message) {
+       final Shell s;
+       if (shell == null) {
+               s = new Shell();
+       } else {
+               s = shell;
+       }
+  
+       Display.getDefault().syncExec(new Runnable() {
+            public void run() {
+                MessageBox dialog = new MessageBox(s, SWT.OK | SWT.MODELESS | SWT.ICON_INFORMATION);
+                dialog.setText(title);
+                dialog.setMessage(message);
+                dialog.open();
+            }
+        });
+    }
+
+       public static boolean openSelectDialog(final Shell shell, final String title, final String message) {
+               final Shell s;
+               if (shell == null) {
+                       s = new Shell();
+               } else {
+                       s = shell;
+               }
+               DialogRun dialog = new DialogRun();
+               dialog.shell = s;
+               dialog.title = title;
+               dialog.message = message;
+               Display.getDefault().syncExec(dialog);
+               System.out.println(dialog.result);
+               return (dialog.result == SWT.YES ? true : false);
+       }
+
+    public static void openErrorDialog(String message) {
+        openErrorDialog(new Shell(), message);
+    }
+    
+    public static void openErrorDialog(final Shell shell, final String message) {
+       Shell s;
+       if (shell == null) {
+               s = new Shell();
+       } else {
+               s = shell;
+       }
+       openErrorDialog(s, "Error", message);
+    }
+
+    public static void openErrorDialog(final Shell shell, final String title, final String message) {
+       final Shell s;
+       if (shell == null) {
+               s = new Shell();
+       } else {
+               s = shell;
+       }
+       Display.getDefault().syncExec(new Runnable() {
+            public void run() {
+                MessageBox dialog = new MessageBox(s, SWT.OK | SWT.MODELESS | SWT.ICON_ERROR);
+                dialog.setText(title);
+                dialog.setMessage(message);
+                dialog.open();
+            }
+        });
+    }
+}
+
+class DialogRun implements Runnable
+{
+       public Shell shell;
+       public String title;
+       public String message;
+       public int result;
+       @Override
+       public void run() {
+        MessageBox dialog = new MessageBox(shell, SWT.YES | SWT.NO | SWT.MODELESS | SWT.ICON_WARNING);
+        dialog.setText(title);
+        dialog.setMessage(message);
+        result = dialog.open();
+       }
+}
diff --git a/org.tizen.injector/src/org/tizen/injector/control/TableViewCellModifier.java b/org.tizen.injector/src/org/tizen/injector/control/TableViewCellModifier.java
new file mode 100644 (file)
index 0000000..ea0a7cf
--- /dev/null
@@ -0,0 +1,141 @@
+/*
+ * org.tizen.injector
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * Jihye Kim <jihye1128.kim@dsamsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.control;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ComboBoxCellEditor;
+import org.eclipse.jface.viewers.ICellModifier;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TextCellEditor;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.tizen.injector.model.ITableVO;
+
+
+/**
+ * This class implements an ICellModifier
+ * An ICellModifier is called when the user modifes a cell in the 
+ * tableViewer
+ */
+
+public class TableViewCellModifier implements ICellModifier {
+       private TableViewer viewer;
+       private String[] columnNames;
+       CellEditor[] cellEditors;
+       /**
+        * Constructor 
+        * @param TableViewerExample an instance of a TableViewerExample 
+        */
+       public TableViewCellModifier(TableViewer viewer) {
+               super();
+               this.viewer = viewer;
+               this.columnNames = getColumnNames();
+               this.viewer.setColumnProperties(columnNames);
+       }
+
+       private String[] getColumnNames() {
+               TableColumn[] columns = viewer.getTable().getColumns();
+               String[] columnNames = new String[columns.length];
+               for(int i=0;i<columnNames.length;i++){
+                       columnNames[i] = columns[i].getText();
+               }
+               
+               return columnNames;
+       }
+
+       /**
+        * @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object, java.lang.String)
+        */
+       public boolean canModify(Object element, String property) {
+               return true;
+       }
+
+       /**
+        * @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object, java.lang.String)
+        */
+       public Object getValue(Object element, String property) {
+               
+               Object result = null;
+               int idx = getColumnIndex(property);
+               ITableVO vo = (ITableVO)element;
+               
+               CellEditor ce = getCellEditor(idx);
+               
+               if(ce instanceof ComboBoxCellEditor){
+                       result = vo.getColumnValue(idx);
+               }else if(ce instanceof TextCellEditor){
+                       result =  vo.getColumnValue(idx);
+               }else{
+                               result = ""; //$NON-NLS-1$
+               }
+               return result;  
+       }
+
+       private CellEditor getCellEditor(int idx) {
+               if(this.cellEditors==null)
+                       this.cellEditors = viewer.getCellEditors();
+               return this.cellEditors[idx];
+       }
+
+       private int getColumnIndex(String property) {
+               for(int i=0;i<columnNames.length;i++){
+                       if(columnNames[i].equals(property))
+                               return i;
+               }
+               return 0;
+       }
+       // not used
+       /*
+       private int getComboIndex(String[] items, Object str) {
+               for(int i=0;i<items.length;i++){
+                       if(items[i].equals(str))
+                               return i;
+               }
+               return 0;
+       }
+       */
+
+       /**
+        * @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object, java.lang.String, java.lang.Object)
+        */
+       public void modify(Object element, String property, Object value) {     
+               int idx = getColumnIndex(property);
+               ITableVO vo = (ITableVO)((TableItem) element).getData();
+               
+               if(cellEditors[idx] instanceof ComboBoxCellEditor){
+                       if((Integer)value < 0)
+                               return;
+                       else
+                               vo.setColumnValue(idx, value);
+               }else if(cellEditors[idx] instanceof TextCellEditor){
+                       vo.setColumnValue(idx, value);
+               }
+               
+               viewer.update(vo, null);
+       }
+}
diff --git a/org.tizen.injector/src/org/tizen/injector/control/TableViewColumnSorter.java b/org.tizen.injector/src/org/tizen/injector/control/TableViewColumnSorter.java
new file mode 100644 (file)
index 0000000..91c3f0b
--- /dev/null
@@ -0,0 +1,161 @@
+/*
+ * org.tizen.injector
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * Jihye Kim <jihye1128.kim@dsamsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.control;
+
+import java.util.Comparator;
+
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.tizen.injector.model.ITableVO;
+
+
+/**
+ * A viewer sorter is used by a structured viewer to reorder the elements
+ * provided by its content provider. In addition, the TableViewColumnSorter
+ * listens for mouse clicks in the column headers and resorts the table content
+ * based on the column that was selected. Clicking on a column a second time
+ * toggles the sort order.
+ */
+public class TableViewColumnSorter extends ViewerSorter {
+       private static final String COLUMN_INDEX_KEY = "COLUMN_INDEX"; //$NON-NLS-1$
+       private static final String HEADER_TEXT_KEY = "HEADER_TEXT"; //$NON-NLS-1$
+       private static final String TAG_DESCENDING = "\u25b2"; // up-pointing triangle
+       private static final String TAG_ASCENDING = "\u25bc"; // down-pointing triangle
+       
+       private TableViewer viewer;
+       private Table table;
+       private TableColumn[] columns;
+       Cursor waitCursor;
+       
+       private Comparator<String> stringComparator = new Comparator<String>(){
+               @Override
+               public int compare(String str1, String str2) {
+                       str1=str1==null?"":str1; //$NON-NLS-1$
+                       str2=str2==null?"":str2; //$NON-NLS-1$
+                       return str1.compareTo(str2);
+               }
+       };
+       
+       private Comparator<Integer> numberComparator = new Comparator<Integer>(){
+               @Override
+               public int compare(Integer num1, Integer num2) {
+                       return num1>num2?1:(num1==num2?0:-1);
+               }
+       };
+
+       public TableViewColumnSorter(TableViewer viewer) {
+               this.viewer = viewer;
+               this.table = viewer.getTable();
+               this.columns = viewer.getTable().getColumns();
+               
+               createCursor();
+               createSelectionListener(columns);
+       }
+
+       private void createCursor(){
+               waitCursor = Display.getCurrent().getSystemCursor(SWT.CURSOR_WAIT);
+       }
+       
+       public int compare(Viewer viewer, Object object1, Object object2) {
+               TableColumn column = table.getSortColumn();
+               
+               int index = -1;
+               if(column==null){
+                       return 0;
+               }else{
+                       index = (Integer)column.getData(COLUMN_INDEX_KEY);
+               }
+               
+               Object target1 = ((ITableVO)object1).getColumnValue(index);
+               Object target2 = ((ITableVO)object2).getColumnValue(index);
+               
+               int result = compare(target1, target2);
+               
+               if(table.getSortDirection()==SWT.UP)
+                       return result;
+               else
+                       return -result;
+       }
+       
+       public int compare(Object object1, Object object2){
+               if(object1 instanceof Integer){
+                       return numberComparator.compare((Integer)object1, (Integer)object2);
+               }else{
+                       return stringComparator.compare(object1.toString(), object2.toString());
+               }
+       }
+
+       private void createSelectionListener(TableColumn[] columns) {
+               for (int i = 0; i < columns.length; i++) {
+                       columns[i].setData(COLUMN_INDEX_KEY,i);
+                       columns[i].setData(HEADER_TEXT_KEY,columns[i].getText());
+                       columns[i].addSelectionListener(new SelectionAdapter() {
+                               @Override
+                               public void widgetSelected(SelectionEvent e) {
+                                       TableColumn column = (TableColumn)e.getSource();
+                                       clearColumnHeader(column);
+                                       renderColumnHeader(column);
+                                       
+                                       table.setCursor(waitCursor);
+                                       viewer.refresh();
+                                       table.setCursor(null);
+                               }
+                       });
+               }
+       }
+       
+       private void renderColumnHeader(TableColumn column){
+               int direction = table.getSortDirection()==SWT.UP?SWT.DOWN:SWT.UP;
+               table.setSortDirection(direction);
+               table.setSortColumn(column);
+               
+               String title = (String)column.getData(HEADER_TEXT_KEY);
+               String directionShape = direction==SWT.UP?TAG_DESCENDING:TAG_ASCENDING;
+               column.setText(title+" "+directionShape); //$NON-NLS-1$
+       }
+       
+       private void clearColumnHeader(TableColumn column){
+               TableColumn prevColumn = table.getSortColumn();
+               
+               if(prevColumn==null){
+                       return;
+               }else{
+                       prevColumn.setText((String)prevColumn.getData(HEADER_TEXT_KEY));
+               }
+       }
+
+}
\ No newline at end of file
diff --git a/org.tizen.injector/src/org/tizen/injector/control/TableViewContentProvider.java b/org.tizen.injector/src/org/tizen/injector/control/TableViewContentProvider.java
new file mode 100644 (file)
index 0000000..a95d949
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * org.tizen.injector
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * Jihye Kim <jihye1128.kim@dsamsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.control;
+
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.tizen.injector.model.ITableModel;
+
+
+public class TableViewContentProvider   implements IStructuredContentProvider {
+
+       public TableViewContentProvider() {
+       }
+
+       public Object[] getElements(Object model) {
+               return ((ITableModel)model).getDatas();
+       }
+
+       public void dispose() {
+               
+       }
+
+       public void inputChanged(Viewer viewer, Object obj, Object obj1) {
+               
+       }
+
+}
diff --git a/org.tizen.injector/src/org/tizen/injector/control/TableViewLabelProvider.java b/org.tizen.injector/src/org/tizen/injector/control/TableViewLabelProvider.java
new file mode 100644 (file)
index 0000000..99c81e2
--- /dev/null
@@ -0,0 +1,131 @@
+/*
+ * org.tizen.injector
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * Jihye Kim <jihye1128.kim@dsamsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.control;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.ComboBoxCellEditor;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.graphics.Image;
+import org.tizen.injector.model.ITableVO;
+
+
+public class TableViewLabelProvider  extends ColumnLabelProvider implements ITableLabelProvider {
+
+       public TableViewLabelProvider() {
+       }
+       
+       private TableViewer viewer;
+       CellEditor[] cellEditors;
+       
+       public TableViewLabelProvider(TableViewer viewer) {
+               this.setViewer(viewer);
+               this.cellEditors = viewer.getCellEditors();
+       }
+       
+       private Field[] fields;
+       
+       private int getColumnIndex(int columnIndex){
+               return fields.length>columnIndex?columnIndex:fields.length;
+       }
+
+       public Image getColumnImage(Object element, int columnIndex) {
+               return null;
+       }
+       
+//     private void hasCellEditor(){
+//             if(this.cellEditors==null)
+//                     this.cellEditors = viewer.getCellEditors();
+//     }
+       
+       private CellEditor getCellEditor(int idx) {
+               if(this.cellEditors==null)
+                       return null;
+               else
+                       return this.cellEditors[idx];
+       }
+
+       public String getColumnText(Object element, int columnIndex) {
+               Object obj = null;
+               
+               if(element instanceof ITableVO){
+                       ITableVO data = (ITableVO)element;
+                       if(this.cellEditors != null){
+                               CellEditor ce = getCellEditor(columnIndex);
+                               if(ce instanceof ComboBoxCellEditor){
+                                       ComboBoxCellEditor editor = (ComboBoxCellEditor)ce;
+                                       String items[] = editor.getItems();
+                                       int idx = (Integer) data.getColumnValue(columnIndex);
+                                       if(idx<0)
+                                               obj = null;
+                                       else if(idx>items.length)
+                                               obj = items[0];
+                                       else
+                                               obj = items[idx];
+                               }else{
+                                       obj = data.getColumnValue(columnIndex);
+                               }
+                       }else{
+                               obj = data.getColumnValue(columnIndex);
+                       }
+               }else{
+                       if(fields==null)
+                               fields = element.getClass().getDeclaredFields();
+                       
+                       int idx = getColumnIndex(columnIndex);
+                       String fieldName = fields[idx].getName().substring(0, 1).toUpperCase()          
+                       + fields[idx].getName().substring(1,fields[idx].getName().length());
+                       
+                       try{
+                               Method method = element.getClass().getMethod("get" + fieldName, new Class[] {}); //$NON-NLS-1$
+                               obj = method.invoke(element, new Object[] {});
+                       }catch(NoSuchMethodException e){
+                               return "NoSuchMethodException"; //$NON-NLS-1$
+                       }catch(Exception e){
+                               return ""; //$NON-NLS-1$
+                       }
+               }       
+               
+               return obj==null?"":String.valueOf(obj); //$NON-NLS-1$
+       }
+
+       public TableViewer getViewer() {
+               return viewer;
+       }
+
+       public void setViewer(TableViewer viewer) {
+               this.viewer = viewer;
+       }
+
+
+}
diff --git a/org.tizen.injector/src/org/tizen/injector/model/AbstractTableModel.java b/org.tizen.injector/src/org/tizen/injector/model/AbstractTableModel.java
new file mode 100644 (file)
index 0000000..75a01c6
--- /dev/null
@@ -0,0 +1,183 @@
+/*
+ * org.tizen.injector
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * Jihye Kim <jihye1128.kim@dsamsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.model;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.XMLMemento;
+
+public abstract class AbstractTableModel implements ITableModel {
+       private static final String TAG_ROOT = "root"; //$NON-NLS-1$
+
+       private Collection<AbstractTableVO> inventory = new ArrayList<AbstractTableVO>();
+       protected AbstractTableVO source;
+       private boolean isDirty = false;
+
+       public AbstractTableModel(AbstractTableVO source) {
+               this.source = source;
+               
+       }
+       
+       
+
+       public ITableVO[] getDatas() {
+               if (inventory == null)
+                       return null;
+
+               return inventory.toArray(new AbstractTableVO[inventory.size()]);
+       }
+
+       public void add(Collection<AbstractTableVO> datas) {
+               if (datas == null)
+                       return;
+
+               inventory.addAll(datas);
+       }
+       
+       public int size(){
+               return inventory.size();
+       }
+
+       public void add(AbstractTableVO data) {
+               inventory.add(data);
+       }
+
+       public void remove(Collection<AbstractTableVO> datas) {
+               if (datas == null)
+                       return;
+
+               inventory.removeAll(datas);
+       }
+
+       public void remove(AbstractTableVO data) {
+               inventory.remove(data);
+       }
+       
+       public void clear() {
+               inventory.clear();
+       }
+
+       public void load(String fileName) {
+               if (inventory==null||source==null)
+                return;
+               
+               FileReader reader = null;
+               try {
+                       reader = new FileReader(new File(fileName));
+                       load(XMLMemento.createReadRoot(reader));
+               } catch (FileNotFoundException e) {
+                       e.printStackTrace();
+               } catch (Exception e) {
+                       e.printStackTrace();
+               } finally {
+                       try {
+                               if (reader != null)
+                                       reader.close();
+                       } catch (IOException e) {
+                               e.printStackTrace();
+                       }
+               }
+       }
+
+       private void load(XMLMemento memento) {
+               IMemento[] children = memento.getChildren(getSourceName());
+               AbstractTableVO data = null;
+               String[] fields = source.getColumnNames();
+               for (int i = 0; i < children.length; i++) {
+                       data = source.clone();
+                       for (int j = 0; j < fields.length; j++) {
+                               data.setColumnValue(j, children[i].getString(fields[j]));
+                       }
+                       add(data);
+               }
+       }
+
+       public void save(String fileName) {
+               if (inventory == null || source == null)
+                       return;
+
+               XMLMemento memento = XMLMemento.createWriteRoot(TAG_ROOT);
+               save(memento);
+               FileWriter writer = null;
+               try {
+                       writer = new FileWriter(fileName);
+                       memento.save(writer);
+               } catch (IOException e) {
+                       e.printStackTrace();
+               } finally {
+                       try {
+                               if (writer != null)
+                                       writer.close();
+                       } catch (IOException e) {
+                               e.printStackTrace();
+                       }
+               }
+       }
+
+       private void save(XMLMemento memento) {
+               Iterator<AbstractTableVO> iter = inventory.iterator();
+               AbstractTableVO data = null;
+               String[] fields = null;
+
+               while (iter.hasNext()) {
+                       data = iter.next();
+                       fields = data.getColumnNames();
+                       IMemento child = memento.createChild(getSourceName());
+                       for (int j = 0; j < fields.length; j++) {
+                               child.putString(
+                                               fields[j], 
+                                               String.valueOf(data.getColumnValue(j)));
+                       }
+               }
+
+       }
+
+       public String getSourceName() {
+               return this.source.getClass().getSimpleName();
+       }
+       
+       public boolean isDirty(){
+               return this.isDirty;
+       }
+       
+       public synchronized void setDirty(boolean isDirty){
+               this.isDirty = isDirty;
+       }
+
+}
+
+
diff --git a/org.tizen.injector/src/org/tizen/injector/model/AbstractTableVO.java b/org.tizen.injector/src/org/tizen/injector/model/AbstractTableVO.java
new file mode 100644 (file)
index 0000000..75f7e94
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * org.tizen.injector
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * Jihye Kim <jihye1128.kim@dsamsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.model;
+
+public abstract class AbstractTableVO implements ITableVO{
+       public abstract String[] getColumnNames();
+       public abstract Object getColumnValue(int index);
+       public abstract void setColumnValue(int index, Object value);
+       
+       public AbstractTableVO clone(){
+               Object obj = null;
+               try{
+                       obj = super.clone();
+               }catch(CloneNotSupportedException e){
+                       
+               }
+               return (AbstractTableVO)obj;
+       }
+       
+       public Object getColumnValue(String columnName){
+               return getColumnValue(getColumnIndex(columnName));
+       }
+       
+       public String getColumnName(int index){
+               String[] columnNames = getColumnNames();
+               if(index<0||index>columnNames.length)
+                       return null;
+               else
+                       return columnNames[index];
+       }
+       
+       public int getColumnIndex(String columnName){
+               String[] columnNames = getColumnNames();
+               int index =-1;
+               for(int i=0;i<columnNames.length;i++){
+                       if(columnName.equals(columnNames[i])){
+                               index = i;
+                               break;
+                       }
+               }
+               return index;
+       }
+       
+       @Override
+       public String toString() {
+               StringBuffer buf = new StringBuffer();
+               String[] fields = getColumnNames();
+               for (int j = 0; j < fields.length; j++) {
+                       Object obj = getColumnValue(j);
+                       buf.append(obj==null?"":String.valueOf(obj)); //$NON-NLS-1$
+                       if(j<fields.length-1)
+                               buf.append(","); //$NON-NLS-1$
+               }
+               return buf.toString();
+       }
+       
+}
diff --git a/org.tizen.injector/src/org/tizen/injector/model/DefaultTableModel.java b/org.tizen.injector/src/org/tizen/injector/model/DefaultTableModel.java
new file mode 100644 (file)
index 0000000..f791fb8
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * org.tizen.injector
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * Jihye Kim <jihye1128.kim@dsamsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.model;
+
+
+public class DefaultTableModel extends AbstractTableModel {
+
+       public DefaultTableModel(AbstractTableVO source) {
+               super(source);
+       }
+
+       public String getSourceName() {
+               String str = this.source.getClass().getSimpleName();
+               if(str.endsWith("VO")) //$NON-NLS-1$
+                       str = str.substring(0,str.length()-2);
+               return str;
+       }
+}
+
+
diff --git a/org.tizen.injector/src/org/tizen/injector/model/ITableModel.java b/org.tizen.injector/src/org/tizen/injector/model/ITableModel.java
new file mode 100644 (file)
index 0000000..70d3e45
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * org.tizen.injector
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * Jihye Kim <jihye1128.kim@dsamsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.model;
+
+import java.util.Collection;
+
+
+public interface ITableModel
+{
+       public void add(AbstractTableVO datas);
+       public void add(Collection<AbstractTableVO> datas);
+       public void remove(AbstractTableVO datas);
+       public void remove(Collection<AbstractTableVO> datas);
+       public ITableVO[] getDatas();
+       public void load(String fileName);
+       public void save(String fileName);
+       public void clear();
+       public int size();
+       public String getSourceName();
+       public boolean isDirty();
+       public void setDirty(boolean isDirty);
+}
diff --git a/org.tizen.injector/src/org/tizen/injector/model/ITableVO.java b/org.tizen.injector/src/org/tizen/injector/model/ITableVO.java
new file mode 100644 (file)
index 0000000..44e0eb2
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * org.tizen.injector
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * Jihye Kim <jihye1128.kim@dsamsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.model;
+
+public interface ITableVO extends IVO{
+       public String[] getColumnNames();
+       public Object getColumnValue(int index);
+       public Object getColumnValue(String columnName);
+       public int getColumnIndex(String columnName);
+       public String getColumnName(int index);
+       public void setColumnValue(int index, Object value);
+}
diff --git a/org.tizen.injector/src/org/tizen/injector/model/IVO.java b/org.tizen.injector/src/org/tizen/injector/model/IVO.java
new file mode 100644 (file)
index 0000000..a9e3282
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * org.tizen.injector
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * Jihye Kim <jihye1128.kim@dsamsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.model;
+
+public interface IVO extends Cloneable{
+}
index 1105db5..3dd93c2 100644 (file)
@@ -4,9 +4,9 @@
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@
 
 package org.tizen.injector.protocol;
 
+import java.nio.BufferUnderflowException;
 import java.nio.ByteBuffer;
 
 import org.tizen.injector.util.ByteUtil;
@@ -174,6 +175,8 @@ abstract public class AbstractGA {
                        buffer.get(buf, 0, buf.length);
                        ((ByteArrayItem) item).setValue(idx, buf);
                }
+               } catch(BufferUnderflowException e){
+                       e.printStackTrace();
                } catch(Exception e){
                        e.printStackTrace();
                }
index 961a5e5..9c77f57 100644 (file)
@@ -4,9 +4,9 @@
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index 7a402c0..cbc452b 100644 (file)
@@ -4,9 +4,9 @@
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index 348b1a4..e5eb91e 100644 (file)
@@ -4,9 +4,9 @@
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index 5d22abf..129a0a4 100644 (file)
@@ -4,9 +4,9 @@
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index af9c7e9..2ac6575 100644 (file)
@@ -4,9 +4,9 @@
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index 1944f87..e0c8b90 100644 (file)
@@ -4,9 +4,9 @@
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index 3cf451f..bff3c12 100644 (file)
@@ -4,9 +4,9 @@
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index 5a502b4..c705a23 100644 (file)
@@ -4,9 +4,9 @@
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index 9f1af32..84eef4b 100644 (file)
@@ -4,9 +4,9 @@
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -42,10 +42,12 @@ import org.tizen.injector.view.InjectorView;
 
 public abstract class AbstractInjectorItem {
        private InjectorView view;
-       
+       private Composite parent;
+
        private ArrayList<AbstractInjectorPage> pageList = new ArrayList<AbstractInjectorPage>();
        
        public void createContents(Composite parent, FormPageUtil formUtil){
+               this.parent = parent;
                addPages();
                        
                TabFolder tabFolder = new TabFolder(parent, SWT.BORDER);
@@ -77,10 +79,23 @@ public abstract class AbstractInjectorItem {
        public void setView(InjectorView view) {
                this.view = view;
        }
-       
-       public ArrayList<Composite> getCategoryItems(String category) {
-               return view.getCategoryCompositeList(category);         
+
+       public ArrayList<AbstractInjectorItem> getCategoryItems(String category) {
+               return view.getCategoryInjectorItemList(category);
        }
-       
+
+       protected ArrayList<AbstractInjectorPage> getPageList() {
+               return pageList;
+       }
+
+       public void initializeContents() {
+               // TODO
+               System.out.println("This doesn't be used yet.");
+       }
+
        abstract protected void addPages();
+
+       public Composite getParent() {
+               return parent;
+       }
 }
index d0b685a..007bdb6 100644 (file)
@@ -4,9 +4,9 @@
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -77,6 +77,11 @@ public abstract class AbstractInjectorPage {
                receiverList.add(receiver);
        }
 
+       public void initializeContents() {
+               // TODO
+               System.out.println("This doesn't be used yet.");
+       }
+
        protected abstract void createContents();
 
        protected abstract void registerReceivers();
index fa486ff..bacd55f 100644 (file)
@@ -4,9 +4,9 @@
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index 031fe66..5787cd8 100644 (file)
@@ -4,9 +4,9 @@
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 package org.tizen.injector.socket;
 
+import java.io.IOException;
 import java.net.DatagramPacket;
 import java.net.DatagramSocket;
 import java.net.InetSocketAddress;
+import java.net.SocketException;
 
 //import org.tizen.injector.DebugLog;
 
@@ -61,6 +63,10 @@ public class LocationSocket  {
                        socket.connect(new InetSocketAddress(ip, port));
 
                        isConnected = true;
+               } catch (SocketException e) {
+                       e.printStackTrace();
+                       disconnect();
+                       throw e;
                } catch (Exception e) {
                        e.printStackTrace();
                        disconnect();
@@ -101,6 +107,9 @@ public class LocationSocket  {
                        socket.send(packet);
 //                     DebugLog.log(bytes);
                        result = true;
+               } catch (IOException e) {
+                       disconnect();
+                       throw e;
                } catch (Exception e) {
                        disconnect();
                        throw e;
diff --git a/org.tizen.injector/src/org/tizen/injector/socket/SDcardSocket.java b/org.tizen.injector/src/org/tizen/injector/socket/SDcardSocket.java
new file mode 100644 (file)
index 0000000..f5ed648
--- /dev/null
@@ -0,0 +1,420 @@
+/*
+ * org.tizen.injector
+ * 
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ *
+ * 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.
+ * 
+ * Contributors:
+ * - S-Core Co., Ltd
+ * 
+ */
+
+package org.tizen.injector.socket;
+
+import org.tizen.common.connection.ConnectionPlugin;
+import org.tizen.sdblib.*;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.IOException;
+import java.net.InetSocketAddress;
+import java.net.Socket;
+import java.net.SocketException;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+
+import org.tizen.injector.receiver.AbstractInjectorReceiver;
+import org.tizen.injector.util.ByteUtil;
+import org.tizen.injector.view.InjectorView;
+
+public class SDcardSocket {
+       private static SDcardSocket sdcardSocket;
+       
+       public static int port = 26103;                                 // default port but it will be changed when connection start
+       private static final String ip = "127.0.0.1"; //$NON-NLS-1$
+
+       private HashMap<String, AbstractInjectorReceiver> receiverMap = new HashMap<String, AbstractInjectorReceiver>();
+
+       private Socket socket;
+       private Socket statusSocket;
+       
+       private BufferedOutputStream output;
+       private BufferedInputStream input;
+       private BufferedOutputStream statusOutput;
+       private BufferedInputStream statusInput;
+       private boolean isConnected = false;
+       public boolean isDataWaiting = false;
+       private Receiver receiverThread;
+       private StatusReceiver statusReceiverThread;
+
+       public boolean isMounted = false, umountOk = true;
+       private IDevice currentDevice = null;
+
+       // Event ID
+       private static int lengthOfID = 10;
+       private static byte[] SDCARD            = new byte[lengthOfID];
+       
+       public HashSet<String> SDpath_set = new HashSet<String>();
+       public String currentSDpath;
+       
+       private SDcardSocket () {
+               int i = 0;
+               for (byte b : new String("sdcard\n").getBytes()) {
+                       SDCARD[i++] = b;
+               }
+       }
+
+       public void addInjectorReceiver(ArrayList<AbstractInjectorReceiver> list) {
+               if (list == null)
+                       return;
+               for (int i = 0; i < list.size(); i++) {
+                       AbstractInjectorReceiver receiver = list.get(i);
+                       receiverMap.put(receiver.getKey(), receiver);
+               }
+       }
+
+       public void removeInjectorReceiver() {
+               receiverMap.clear();
+       }
+
+       public static SDcardSocket getInstance() {
+               if (sdcardSocket == null)
+                       sdcardSocket = new SDcardSocket();
+               return sdcardSocket;
+       }
+       
+       public void queryMountStatus() throws Exception {
+               int sleepCnt = 0;
+               SDpath_set.clear();
+               try {
+                       IDevice[] device_list = SmartDevelopmentBridge.getBridge().getDevices();
+                       
+                       for(int i = 0; i < device_list.length; i++)
+                       {
+                               statusSocket = new Socket();
+                               String str_localport = device_list[i].getSerialNumber();
+                               port = Integer.parseInt(str_localport.substring(9, str_localport.length())) + 3;        
+                               statusSocket.connect(new InetSocketAddress(ip, port), 1000);
+
+                               statusOutput = new BufferedOutputStream(statusSocket.getOutputStream());
+                               statusInput = new BufferedInputStream(statusSocket.getInputStream());
+                               
+                               statusReceiverThread = new StatusReceiver();
+                               statusReceiverThread.start();
+                               
+                               isDataWaiting = true;
+                               sendMountCheck();
+               
+                               while(isDataWaiting)
+                               {
+                                       if(sleepCnt > 200)
+                                       {
+                                               sleepCnt = 0;
+                                               isDataWaiting = false;
+                                       }
+                                       
+                                       Thread.sleep(1);
+                                       sleepCnt += 1;
+                               }
+                       }
+               } catch (IOException e) {
+                       e.printStackTrace();
+                       throw e;
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+       
+       public void connect() throws Exception {
+               if (isConnected() && InjectorView.activated == true)
+                       return;
+               else
+                       disconnect();
+
+               socket = new Socket();
+               
+               try{
+                       socket.setKeepAlive(true);
+                       currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
+                       if(currentDevice == null)
+                               return;
+                       String str_localport = currentDevice.getSerialNumber();
+                       port = Integer.parseInt(str_localport.substring(9, str_localport.length())) + 3;
+                       socket.connect(new InetSocketAddress(ip, port), 1000);
+
+                       this.output = new BufferedOutputStream(socket.getOutputStream());
+                       this.input = new BufferedInputStream(socket.getInputStream());
+
+                       receiverThread = new Receiver();
+                       receiverThread.start();
+                       
+                       isConnected = true;
+               } catch (SocketException e) {
+                       return;
+               } catch (Exception e) {
+                       e.printStackTrace();
+                       throw e;
+               }
+       }
+
+       private boolean isConnected() {
+               return isConnected && socket != null && !socket.isClosed()
+                               && socket.isConnected();
+       }
+
+       public void disconnect() {
+               if (!isConnected)
+                       return;
+
+               try {
+                       if (receiverThread != null)
+                               receiverThread.shutdown();
+                       if (output != null)
+                               output.close();
+                       if (input != null)
+                               input.close();                  
+                       isConnected = false;
+               } catch (SocketException e) {
+                       return;
+               } catch (Exception e) {
+                       e.printStackTrace();
+               } finally {
+                       if (socket != null) {
+                               try {
+                                       socket.close();
+                               } catch (SocketException e) {
+                                       return;
+                               } catch (IOException e) {
+                                       e.printStackTrace();
+                               }
+                       }
+               }
+       }
+       
+       public void sendMountCheck() throws IOException {
+               String sdcardMsg = "2\n";               // query mount status
+               try {
+                       statusOutput.write(SDCARD, 0, lengthOfID);
+                       statusOutput.flush();
+       
+                       byte[] next_packet_length = { (byte)sdcardMsg.getBytes().length, 0x00, 0x00, 0x00 };
+                       statusOutput.write(next_packet_length);
+                       statusOutput.flush();
+       
+                       byte[] main = sdcardMsg.getBytes();
+                       if (main.length > 0)
+                       {
+                               statusOutput.write(main, 0, main.length);
+                       }
+                       statusOutput.flush();
+               } catch (SocketException e) {
+                       disconnect();
+               } catch (Exception e) {
+                       e.printStackTrace();
+                       disconnect();
+               }
+       }
+       
+       public void getCurrentMountStatus() throws IOException {
+               String sdcardMsg = "2\n";               // query mount status
+               try {
+                       output.write(SDCARD, 0, lengthOfID);
+                       output.flush();
+       
+                       byte[] next_packet_length = { (byte)sdcardMsg.getBytes().length, 0x00, 0x00, 0x00 };
+                       output.write(next_packet_length);
+                       output.flush();
+       
+                       byte[] main = sdcardMsg.getBytes();
+                       if (main.length > 0)
+                       {
+                               output.write(main, 0, main.length);
+                       }
+                       output.flush();
+               } catch (SocketException e) {
+                       disconnect();
+               } catch (Exception e) {
+                       e.printStackTrace();
+                       disconnect();
+               }
+       }
+       
+       public boolean sendSDcard(String sdcardMsg) throws Exception {
+               if (!isConnected())
+                       connect();
+
+               boolean result = false;
+               try {
+                       output.write(SDCARD, 0, lengthOfID);
+                       output.flush();
+
+                       byte[] next_packet_length = { (byte)sdcardMsg.getBytes().length, 0x00, 0x00, 0x00 };
+                       output.write(next_packet_length);
+                       output.flush();
+
+                       byte[] main = sdcardMsg.getBytes();
+                       if (main.length > 0)
+                       {
+                               output.write(main, 0, main.length);
+                       }
+                       output.flush();
+                       result = true;
+               } catch (SocketException e) {
+                       disconnect();
+                       return false;
+               } catch (Exception e) {
+                       e.printStackTrace();
+                       disconnect();
+                       throw e;
+               }
+               return result;
+       }
+
+       private class StatusReceiver extends Thread {
+               private boolean hasActiveReceiver = true;
+                               
+               public void run() {
+                       try {
+                               byte[] buf = null;
+                               ByteBuffer byteBuffer = null;
+                               int length;
+                               int groupId;
+                               int actionId;
+                               while (hasActiveReceiver) {
+                                       buf = new byte[4];
+                                       statusInput.read(buf, 0, buf.length);
+                                       byteBuffer = ByteUtil.getByteBuffer(buf);
+                                       length = byteBuffer.getShort();                                 
+                                       groupId = byteBuffer.get() & 0xff;
+                                       actionId = byteBuffer.get() & 0xff;
+                                       
+                                       if (length != 0) {
+                                               buf = new byte[length];
+                                               statusInput.read(buf, 0, buf.length);
+                                       }
+
+                                       // if sdcard
+                                       if(groupId == 11)
+                                       {
+                                               String SDpath = new String(buf, "US-ASCII");
+                                               
+                                               if(actionId == 2) // umounted status
+                                               {
+                                                               isMounted = false;
+                                                               isDataWaiting = false;
+                                               }
+                                               else if(actionId == 3) // mounted status
+                                               {
+                                                               isMounted = true;
+                                                               SDpath_set.add(SDpath);
+                                                               isDataWaiting = false;
+                                                               currentSDpath = SDpath;
+                                               }
+                                               else
+                                                               continue;
+                                       }
+                               }
+                       } catch (SocketException e) {
+                               return;
+                       } catch (Exception e) {
+                               e.printStackTrace();
+                       }
+               }
+       }
+       
+       private class Receiver extends Thread {
+               private boolean hasActiveReceiver = true;
+                               
+               public void run() {
+                       try {                           
+                               byte[] buf = null;
+                               ByteBuffer byteBuffer = null;
+                               int length;
+                               int groupId;
+                               int actionId;
+                               while (hasActiveReceiver) {
+                                       buf = new byte[4];
+                                       input.read(buf, 0, buf.length);
+                                       byteBuffer = ByteUtil.getByteBuffer(buf);
+                                       length = byteBuffer.getShort();                                 
+                                       groupId = byteBuffer.get() & 0xff;
+                                       actionId = byteBuffer.get() & 0xff;
+                                       
+                                       if (length != 0) {
+                                               buf = new byte[length];
+                                               input.read(buf, 0, buf.length);
+                                       }
+
+                                       // if sdcard
+                                       if(groupId == 11)
+                                       {
+                                               String SDpath = new String(buf, "US-ASCII");
+                                               
+                                               if(actionId == 0)       // unmounted
+                                               {
+                                                               isMounted = false;
+                                                               SDpath_set.remove(SDpath);
+                                                               currentSDpath = "unmounted";
+                                                               umountOk = true;
+                                               }
+                                               else if(actionId == 1)  // mounted
+                                               {
+                                                               isMounted = true;
+                                                               SDpath_set.add(SDpath);
+                                                               currentSDpath = SDpath;
+                                               }
+                                               else if(actionId == 2) // umounted status
+                                               {
+                                                               isMounted = false;
+                                                               SDpath_set.remove(SDpath);
+                                                               isDataWaiting = false;
+                                               }
+                                               else if(actionId == 3) // mounted status
+                                               {
+                                                               isMounted = true;
+                                                               SDpath_set.add(SDpath);
+                                                               isDataWaiting = false;
+                                                               currentSDpath = SDpath;
+                                               }
+                                               else if(actionId == 4)  // umount failed
+                                               {
+                                                               umountOk = false;
+                                               }
+                                               else if(actionId == 5)  // mount failed
+                                               {
+                                                       System.out.println("mount failed");
+                                               }
+                                               else
+                                                               continue;
+                                       }
+                               }
+                       } catch (SocketException e) {
+                               return;
+                       } catch (Exception e) {
+                               e.printStackTrace();
+                       }
+               }
+
+               private void shutdown() {
+                       this.hasActiveReceiver = false;
+               }
+       }
+}
index 5dfef23..5ba4ab5 100644 (file)
@@ -4,9 +4,9 @@
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -70,6 +70,10 @@ public class SensorTCPSocket {
                        this.input = new BufferedInputStream(socket.getInputStream());
 
                        isConnected = true;
+               } catch (IOException e) {
+                       e.printStackTrace();
+                       disconnect();
+                       throw e;
                } catch (Exception e) {
                        e.printStackTrace();
                        disconnect();
@@ -127,6 +131,10 @@ public class SensorTCPSocket {
                        
                        output.flush();
                        result = true;
+               } catch (IOException e) {
+                       e.printStackTrace();
+                       disconnect();
+                       throw e;
                } catch (Exception e) {
                        e.printStackTrace();
                        disconnect();
index bdbf697..edb39e2 100644 (file)
@@ -4,9 +4,9 @@
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 package org.tizen.injector.socket;
 
+import java.io.IOException;
 import java.net.DatagramPacket;
 import java.net.DatagramSocket;
 import java.net.InetSocketAddress;
+import java.net.SocketException;
 
 //import org.tizen.injector.DebugLog;
 
@@ -61,6 +63,10 @@ public class SensorUDPSocket {
                        socket.connect(new InetSocketAddress(ip, port));
 
                        isConnected = true;
+               } catch (SocketException e) {
+                       e.printStackTrace();
+                       disconnect();
+                       throw e;
                } catch (Exception e) {
                        e.printStackTrace();
                        disconnect();
@@ -102,6 +108,9 @@ public class SensorUDPSocket {
                        socket.send(packet);
 //                     DebugLog.log(sentence);
                        result = true;
+               } catch (IOException e) {
+                       disconnect();
+                       result = false;
                } catch (Exception e) {
                        disconnect();
                        result = false;
index a5b48f9..5e2125f 100644 (file)
@@ -4,9 +4,9 @@
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -65,9 +65,49 @@ public class TelephonySocket {
        private BufferedInputStream input;
        private boolean isConnected = false;
        private Receiver receiverThread;
-       public boolean callWaiting = false;
+       public boolean callWaiting = true;
+       private boolean isMsgReceived = false;
        private IDevice currentDevice = null;
+
+       // Event ID
+       private static int lengthOfID = 10;
+       private static byte[] TELEPHONY = new byte[lengthOfID];
+       private static byte[] SENSOR    = new byte[lengthOfID];
+       private static byte[] LOCATION  = new byte[lengthOfID];
+       private static byte[] NFC               = new byte[lengthOfID];
+       
+       public void setMsgReceived(boolean status)
+       {
+               isMsgReceived = status;
+       }
+       
+       public boolean getMsgReceived()
+       {
+               return isMsgReceived;
+       }
        
+       private TelephonySocket () {
+               int i = 0;
+               for (byte b : new String("telephony\n").getBytes()) {
+                       TELEPHONY[i++] = b;
+               }
+
+               i = 0;
+               for (byte b : new String("sensor\n").getBytes()) {
+                       SENSOR[i++] = b;
+               }
+
+               i = 0;
+               for (byte b : new String("location\n").getBytes()) {
+                       LOCATION[i++] = b;
+               }
+
+               i = 0;
+               for (byte b : new String("nfc\n").getBytes()) {
+                       NFC[i++] = b;
+               }
+       }
+
        public void addInjectorReceiver(ArrayList<AbstractInjectorReceiver> list) {
                if (list == null)
                        return;
@@ -94,7 +134,7 @@ public class TelephonySocket {
                        disconnect();
 
                socket = new Socket();
-
+               
                try {
                        socket.setKeepAlive(true);
                        currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
@@ -162,8 +202,7 @@ public class TelephonySocket {
 
        private void sendInitialize() throws IOException {
                try {
-                       String str = "telephony\n";
-                       output.write(str.getBytes(), 0, str.length());
+                       output.write(TELEPHONY, 0, lengthOfID);
                        output.flush();
                        
                        byte[] abuf = { 0x04, 0x00, 0x40, 0x41 };
@@ -173,8 +212,8 @@ public class TelephonySocket {
                        byte[] bbuf = { 0x16, 0x00, 0x00, 0x00 };
                        output.write(bbuf);
                        output.flush();
-                       
-                       output.write(str.getBytes(), 0, str.length());
+
+                       output.write(TELEPHONY, 0, lengthOfID);
                        output.flush();
                        
                        byte[] cbuf = { 0x00, 0x00, 0x40, 0x47 };
@@ -195,8 +234,7 @@ public class TelephonySocket {
                if (!isConnected())
                        connect();
                try {
-                       String str = "telephony\n";
-                       output.write(str.getBytes(), 0, str.length());
+                       output.write(TELEPHONY, 0, lengthOfID);
                        output.flush();
                        
                        byte[] buf = { 0x00, 0x00, 0x11, 0x5b };
@@ -217,8 +255,7 @@ public class TelephonySocket {
                        return;
 
                try{
-                       String str = "telephony\n";
-                       output.write(str.getBytes(), 0, str.length());
+                       output.write(TELEPHONY, 0, lengthOfID);
                        output.flush();
                        
                        byte[] abuf = { 0x00, 0x00, 0x10, 0x01 };
@@ -244,8 +281,7 @@ public class TelephonySocket {
 
                boolean result = false;
                try {
-                       String str = "telephony\n";
-                       output.write(str.getBytes(), 0, str.length());
+                       output.write(TELEPHONY, 0, lengthOfID);
                        output.flush();
                        
                        byte[] starter = sendObj.makeStarterPacket();
@@ -277,13 +313,12 @@ public class TelephonySocket {
 
                boolean result = false;
                try {
-                       String str = "sensor\n\n\n\n";
                        if(output != null)
                                output.flush();
                        else
                                return false;
-                       
-                       output.write(str.getBytes(), 0, str.length());
+
+                       output.write(SENSOR, 0, lengthOfID);
                        output.flush();
                        
                        byte[] next_packet_length = { (byte)sensorMsg.getBytes().length, 0x00, 0x00, 0x00 };
@@ -313,14 +348,13 @@ public class TelephonySocket {
 
                boolean result = false;
                try {
-                       String str = "location\n\n";
-                       output.write(str.getBytes(), 0, str.length());
+                       output.write(LOCATION, 0, lengthOfID);
                        output.flush();
                        
                        byte[] next_packet_length = { (byte)locationMsg.getBytes().length, 0x00, 0x00, 0x00 };
                        output.write(next_packet_length);
                        output.flush();
-                       
+
                        byte[] main = locationMsg.getBytes();
                        if (main.length > 0) {
                                output.write(main, 0, main.length);
@@ -344,23 +378,21 @@ public class TelephonySocket {
 
                boolean result = false;
                try {
-                       String str = "nfc\n\n\n\n\n\n\n";
-                       output.write(str.getBytes(), 0, str.length());
+                       output.write(NFC, 0, lengthOfID);
                        output.flush();
 
-                       String msgLen = Integer.toString(nfcMsg.getBytes().length);
-                       while(msgLen.length() < 5)
-                       {
-                               msgLen = msgLen + "\n";
-                       }
-                       output.write(msgLen.getBytes(), 0 , msgLen.length());
+                       byte[] messasge = nfcMsg.getBytes();
+
+                       ByteBuffer header = ByteUtil.getByteBuffer(4);
+                       header.putShort((short)messasge.length);
+                       header.put((byte)0x00);
+                       header.put((byte)0x00);
+                       output.write(header.array(), 0, 4);
                        output.flush();
-                       
-                       byte[] main = nfcMsg.getBytes();
-                       if (main.length > 0)
+
+                       if (messasge.length > 0)
                        {
-//                             ByteUtil.printHex(main, "send body");
-                               output.write(main, 0, main.length);
+                               output.write(messasge, 0, messasge.length);
                        }
                        output.flush();
                        result = true;
@@ -399,8 +431,9 @@ public class TelephonySocket {
                                                input.read(buf, 0, buf.length);
 //                                             ByteUtil.printHex(buf, "receive body");
                                        }
-
+                                       
                                        // groupid 3: GSM_SUPS, actionid 73: GSM_SUPS_SET_CW_REQ
+                                       // groupid 4: GSM_SMS, actionid 12: GSM_SMS_RECEIVE_RES
                                        if(groupId == 3 && actionId == 73)
                                        {
                                                for(int i = 0; i < buf.length; i++)
@@ -414,6 +447,11 @@ public class TelephonySocket {
                                                        }
                                                }
                                        }
+                                       else if(groupId == 4 && actionId == 12)
+                                       {
+                                               isMsgReceived = true;
+                                               continue;
+                                       }
 
                                        final AbstractInjectorReceiver receiver = getTelephonyReceiver(
                                                        groupId, actionId);
index 8c32707..53b60a0 100644 (file)
@@ -4,9 +4,9 @@
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -88,6 +88,8 @@ public class InjectorStateProvider extends AbstractSourceProvider {
                        InjectorStateProvider provider = (InjectorStateProvider)service.getSourceProvider(InjectorStateProvider.STATE_ID);
                        provider.setState(state);
 //                     provider.setConnectionStatus(state.equals("ON")?true:false);
+               } catch (IllegalStateException e) {
+                       e.printStackTrace();
                } catch (Exception e) {
                        e.printStackTrace();
                }
index 61f6499..c156c4b 100644 (file)
@@ -4,9 +4,9 @@
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
index b387fa7..4b466b3 100644 (file)
@@ -4,9 +4,9 @@
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,8 +27,6 @@
 
 package org.tizen.injector.util;
 
-import java.awt.TextArea;
-
 import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.browser.Browser;
@@ -149,6 +147,10 @@ public class FormPageUtil {
                return label;
        }
 
+       public Label createSeperator(Composite parent, boolean isVertical) {
+               return toolkit.createLabel(parent, "", SWT.SEPARATOR |
+                                                                       (isVertical ? SWT.VERTICAL : SWT.HORIZONTAL));
+       }
        public Text createText(Composite parent, String title) {
                Text text = toolkit.createText(parent, title, SWT.BORDER);
                text.setTextLimit(TEXT_LIMIT);
index e84eaf3..1b09c90 100644 (file)
@@ -4,9 +4,9 @@
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
  *\r
  * Contact: \r
- * Sungmin Ha <sungmin82.ha@samsung.com>\r
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>\r
- * DongKyun Yun <dk77.yun@samsung.com>\r
  *\r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
index 01f2b4a..85f01eb 100644 (file)
@@ -4,9 +4,9 @@
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
  *\r
  * Contact: \r
- * Sungmin Ha <sungmin82.ha@samsung.com>\r
+ * Sooyoung Ha <yoosah.ha@samsung.com>
+ * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>\r
- * DongKyun Yun <dk77.yun@samsung.com>\r
  *\r
  * Licensed under the Apache License, Version 2.0 (the "License");\r
  * you may not use this file except in compliance with the License.\r
@@ -27,6 +27,7 @@
 \r
 package org.tizen.injector.view;\r
 \r
+import java.net.SocketException;\r
 import java.util.ArrayList;\r
 \r
 import org.eclipse.core.runtime.CoreException;\r
@@ -53,9 +54,8 @@ import org.tizen.injector.provider.AbstractInjectorItem;
 import org.tizen.injector.socket.TelephonySocket;\r
 import org.tizen.injector.sourceProvider.InjectorStateProvider;\r
 import org.tizen.injector.util.FormPageUtil;\r
-import org.tizen.sdblib.FileListingService.FileEntry;\r
 import org.tizen.sdblib.IDevice;\r
-import org.tizen.sdblib.Log;\r
+import org.tizen.sdblib.service.FileEntry;\r
 \r
 public class InjectorView extends ViewPart implements\r
 ISelectionListener {\r
@@ -69,16 +69,19 @@ ISelectionListener {
        static public boolean desposing = false;\r
        static public boolean activated = false;\r
        static public boolean disconnect_finished = true;\r
-\r
+       static private TabFolder tabFolder;\r
        public final static String VIEW_ID = "org.tizen.injector.view.InjectorView";\r
 \r
+       /*\r
        private String errorMessage = Messages.InjectorView_6\r
                        + System.getProperty("line.separator") //$NON-NLS-1$\r
                        + Messages.InjectorView_8;\r
+       */\r
 \r
        private ArrayList<String> categoryList = new ArrayList<String>();\r
        private ArrayList<FormPageUtil> formUtilList = new ArrayList<FormPageUtil>();\r
-       private ArrayList<ArrayList<Composite>> compositeArrayList = new ArrayList<ArrayList<Composite>>();\r
+//     private ArrayList<ArrayList<Composite>> compositeArrayList = new ArrayList<ArrayList<Composite>>();\r
+       private ArrayList<ArrayList<AbstractInjectorItem>> injectorItemList = new ArrayList<ArrayList<AbstractInjectorItem>>();\r
 \r
        private final ArrayList<ISelectionListener> listeners = new ArrayList<ISelectionListener>();\r
        private static InjectorView view = null;\r
@@ -92,10 +95,13 @@ ISelectionListener {
                view = this;\r
                getCategories();\r
 \r
-               TabFolder tabFolder = createTabFolder(parent);\r
+               Composite compositeBase = new Composite(parent, SWT.NONE);\r
+               compositeBase.setLayout(new FillLayout());\r
+                               \r
+               tabFolder = createTabFolder(compositeBase);\r
 \r
                for (int i = 0; i < categoryList.size(); i++) {\r
-                       compositeArrayList.add(new ArrayList<Composite>());\r
+                       injectorItemList.add(new ArrayList<AbstractInjectorItem>());\r
                        TabItem tabItem = createTabItem(tabFolder, categoryList.get(i));\r
                        formUtilList\r
                                        .add(new FormPageUtil((Composite) tabItem.getControl()));\r
@@ -106,24 +112,26 @@ ISelectionListener {
        }\r
 \r
        private TabFolder createTabFolder(Composite parent) {\r
-               TabFolder tabFolder = new TabFolder(parent, SWT.NONE);\r
-               tabFolder.setLayout(new FillLayout());\r
+               tabFolder = new TabFolder(parent, SWT.NONE);\r
 \r
                return tabFolder;\r
        }\r
 \r
        private TabItem createTabItem(TabFolder parent, String text) {\r
                TabItem tabItem = new TabItem(parent, SWT.NONE);\r
-               tabItem.setText(text);\r
+               if(text.length() < 5)\r
+                       tabItem.setText(String.format("%-16s", text));\r
+               else if(text.length() < 10)\r
+                       tabItem.setText(String.format("%-13s", text));\r
+               else\r
+                       tabItem.setText(text);\r
                tabItem.setControl(createTabItemComposite(parent));\r
-\r
                return tabItem;\r
        }\r
 \r
        private Composite createTabItemComposite(Composite parent) {\r
                Composite composite = new Composite(parent, SWT.NONE);\r
                composite.setLayout(new FillLayout());\r
-\r
                return composite;\r
        }\r
 \r
@@ -200,13 +208,14 @@ ISelectionListener {
                                                        Composite client = formUtilList.get(index)\r
                                                                        .createCategory(name);\r
                                                        client.getParent().setEnabled(false);\r
-                                                       compositeArrayList.get(index).add(client);\r
+                                                       //compositeArrayList.get(index).add(client);\r
                                                        try {\r
                                                                executor = (AbstractInjectorItem) (configElements[i]\r
                                                                                .createExecutableExtension(ATTR_CLASS));\r
                                                                executor.createContents(client, formUtilList\r
                                                                                .get(index));\r
                                                                executor.setView(this);\r
+                                                               injectorItemList.get(index).add(executor);\r
                                                        } catch (CoreException e) {\r
                                                                e.printStackTrace();\r
                                                        }\r
@@ -218,16 +227,26 @@ ISelectionListener {
        }\r
 \r
        public void activate() {\r
+               /*\r
                for (int i = 0; i < compositeArrayList.size(); i++) {\r
                        for (int j = 0; j < compositeArrayList.get(i).size(); j++) {\r
                                Composite client = compositeArrayList.get(i).get(j);\r
                                client.getParent().setEnabled(true);\r
                        }\r
                }\r
+               */\r
+\r
+               for (int i = 0; i < injectorItemList.size(); i++) {\r
+                       for (int j = 0; j < injectorItemList.get(i).size(); j++) {\r
+                               Composite client = injectorItemList.get(i).get(j).getParent();\r
+                               client.getParent().setEnabled(true);\r
+                       }\r
+               }\r
                activated = true;\r
        }\r
 \r
        public void inactivateUI() {\r
+               /*\r
                for (int i = 0; i < compositeArrayList.size(); i++) {\r
                        for (int j = 0; j < compositeArrayList.get(i).size(); j++) {\r
                                Composite client = compositeArrayList.get(i).get(j);\r
@@ -236,6 +255,15 @@ ISelectionListener {
                                section.setEnabled(false);\r
                        }\r
                }\r
+               */\r
+               for (int i = 0; i < injectorItemList.size(); i++) {\r
+                       for (int j = 0; j < injectorItemList.get(i).size(); j++) {\r
+                               Composite client = injectorItemList.get(i).get(j).getParent();\r
+                               Section section = (Section) client.getParent();\r
+                               section.setExpanded(false);\r
+                               section.setEnabled(false);\r
+                       }\r
+               }\r
                activated = false;\r
        }\r
 \r
@@ -263,6 +291,8 @@ ISelectionListener {
                                                        InjectorView.VIEW_ID);\r
                                        if (view != null && currentDevice != null)\r
                                                view.activate();\r
+                               } catch (SocketException e) {\r
+                                       e.printStackTrace();\r
                                } catch (Exception e) {\r
                                        //initSocket();\r
                                        //DialogUtil.openErrorDialog(errorMessage);\r
@@ -293,14 +323,14 @@ ISelectionListener {
 \r
 //     @Override\r
        public void disconnect() {\r
-               try {\r
+//             try {\r
                        TelephonySocket.getInstance().disconnect();\r
 //                     SensorUDPSocket.getInstance().disconnect();\r
 //                     SensorTCPSocket.getInstance().disconnect();\r
 //                     LocationSocket.getInstance().disconnect();\r
-               } catch (Exception e) {\r
+/*             } catch (Exception e) {\r
                        e.printStackTrace();\r
-               }\r
+               } comment out try/catch */\r
        \r
                InjectorStateProvider.changeSyslogState(InjectorStateProvider.STATE_OFF);\r
                if(PlatformUI.getWorkbench() == null || PlatformUI.getWorkbench()\r
@@ -331,13 +361,13 @@ ISelectionListener {
                if (desposing != true) {\r
                        job.schedule();\r
                }\r
-               */\r
+*/\r
        }\r
        \r
        public ArrayList<String> getCategoryList() {\r
                return this.categoryList;\r
        }\r
-       \r
+       /*\r
        public ArrayList<Composite> getCategoryCompositeList(String category) { \r
                int i = categoryList.indexOf(category);\r
                \r
@@ -347,17 +377,15 @@ ISelectionListener {
                \r
                return null;\r
        }\r
-\r
-       // 1000 -> 1초\r
-       public void MatrixTime(int delayTime)\r
-       {\r
-           long saveTime = System.currentTimeMillis();\r
-           long currTime = 0;\r
-\r
-           while( currTime - saveTime < delayTime)\r
-           {\r
-               currTime = System.currentTimeMillis();\r
-           }\r
+       */\r
+       public ArrayList<AbstractInjectorItem> getCategoryInjectorItemList(String category) {   \r
+               int i = categoryList.indexOf(category);\r
+               \r
+               if(i > -1) {\r
+                       return injectorItemList.get(i);\r
+               }\r
+               \r
+               return null;\r
        }\r
                        \r
        @Override\r
@@ -368,26 +396,34 @@ ISelectionListener {
                        disconnect();\r
                        notifySelectionListeners(selectedEntry);\r
                        return;\r
-               } else if (!selectedEntry.getFileListingService().getDevice().isEmulator()) {\r
+               } else if (!selectedEntry.getDevice().isEmulator()) {\r
+                       System.out.println("This is not the Emulator\n");\r
+                       disconnect();\r
                        return;\r
                }\r
-               \r
-               String selectedName = selectedEntry.getFileListingService().getDevice().getSerialNumber();\r
-               if(currentDevice == null && selectedName/*selectedEntry.getName()*/ != null)\r
-               {\r
-                       connect();\r
-                       currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();\r
-               } else if (currentDevice.getSerialNumber() !=  selectedName/*selectedEntry.getName()*/) {\r
-                       disconnect_finished = false;\r
-                       disconnect();\r
-                       connect();\r
-                       currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();\r
-               } else if(activated == false)\r
+\r
+               String selectedName = selectedEntry.getDevice().getSerialNumber();\r
+               if(currentDevice == null)\r
                {\r
-                       connect();\r
-                       currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();\r
-               } else if (currentDevice.getSerialNumber() ==  selectedName/*selectedEntry.getName()*/) {\r
-                       return;\r
+                       if (selectedName/*selectedEntry.getName()*/ != null) {\r
+                               connect();\r
+                               currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();\r
+                       }\r
+               } else {\r
+                       if (currentDevice.getSerialNumber() !=  selectedName/*selectedEntry.getName()*/) {\r
+                               disconnect_finished = false;\r
+                               disconnect();\r
+                               connect();\r
+                               currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();\r
+                       } else {\r
+                               if(activated == false) {\r
+                                       connect();\r
+                                       currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();\r
+                               } else {\r
+//                                     return;\r
+                                       System.out.println("activated is true");\r
+                               }\r
+                       }\r
                }\r
 \r
                notifySelectionListeners(selectedEntry);\r
@@ -407,11 +443,11 @@ ISelectionListener {
                                new ISelectionListener[listeners.size()]);\r
                \r
                for (ISelectionListener listener : listenersCopy)       {\r
-                       try {\r
+//                     try {\r
                                listener.selectionChanged(file);                        \r
-                       } catch (Exception e) {\r
+/*                     } catch (Exception e) {\r
                                Log.e("ConnectionPlugin", e);\r
-                       }\r
+                       }*/\r
               }\r
        }\r
 }\r
index 2a276ce..57043f5 100644 (file)
@@ -4,9 +4,9 @@
  * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * Contact: 
+ * Sooyoung Ha <yoosah.ha@samsung.com>
  * Sungmin Ha <sungmin82.ha@samsung.com>
  * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
diff --git a/org.tizen.location.core/META-INF/MANIFEST.MF b/org.tizen.location.core/META-INF/MANIFEST.MF
deleted file mode 100644 (file)
index b16bf67..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Tizen Event Injector Location Core
-Bundle-SymbolicName: org.tizen.location.core;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Vendor: Samsung
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Export-Package: org.tizen.location.core.injector,
- org.tizen.location.core.model,
- org.tizen.location.core.protocol
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.tizen.common,
- org.tizen.injector,
- org.tizen.common.connection
-Import-Package: org.tizen.common.model
diff --git a/org.tizen.location.log/OSGI-INF/l10n/bundle.properties b/org.tizen.location.log/OSGI-INF/l10n/bundle.properties
deleted file mode 100644 (file)
index c8f3cb8..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#Properties file for org.tizen.location.log
-Bundle-Vendor = Tizen
-Bundle-Name = Tizen SDK Location Log
-Log = Log
\ No newline at end of file
diff --git a/org.tizen.location.manual/OSGI-INF/l10n/bundle.properties b/org.tizen.location.manual/OSGI-INF/l10n/bundle.properties
deleted file mode 100644 (file)
index ba59d98..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#Properties file for org.tizen.location.manual
-Bundle-Vendor = Tizen
-Bundle-Name = Tizen SDK Location Manual
-Manual = Manual
\ No newline at end of file
diff --git a/org.tizen.location.map/.project b/org.tizen.location.map/.project
deleted file mode 100644 (file)
index 51cdcb9..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-       <name>org.tizen.location.map</name>
-       <comment></comment>
-       <projects>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>org.eclipse.jdt.core.javabuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.ManifestBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.SchemaBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>org.eclipse.pde.PluginNature</nature>
-               <nature>org.eclipse.jdt.core.javanature</nature>
-       </natures>
-</projectDescription>
diff --git a/org.tizen.location.map/OSGI-INF/l10n/bundle.properties b/org.tizen.location.map/OSGI-INF/l10n/bundle.properties
deleted file mode 100644 (file)
index 90b89c9..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#Properties file for org.tizen.location.map
-Bundle-Vendor = Tizen
-Bundle-Name = Tizen SDK Location Map
-Map = Map
\ No newline at end of file
diff --git a/org.tizen.nfc/.project b/org.tizen.nfc/.project
deleted file mode 100644 (file)
index af6f26a..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-       <name>org.tizen.nfc</name>
-       <comment></comment>
-       <projects>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>org.eclipse.jdt.core.javabuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.ManifestBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.SchemaBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>org.eclipse.pde.PluginNature</nature>
-               <nature>org.eclipse.jdt.core.javanature</nature>
-       </natures>
-</projectDescription>
diff --git a/org.tizen.nfc/src/org/tizen/nfc/page/NfcPage.java b/org.tizen.nfc/src/org/tizen/nfc/page/NfcPage.java
deleted file mode 100644 (file)
index 12992a0..0000000
+++ /dev/null
@@ -1,960 +0,0 @@
-/*
- * org.tizen.nfc.tag.page
- *
- * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Jihye kim <jihye1128.kim@samsung.com>
- * Sungmin Ha <sungmin82.ha@samsung.com>
- * Yeongkyoon Lee <yeongkyoon.lee@samsung.com>
- *
- * 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.
- *
- * Contributors:
- * - S-Core Co., Ltd
- */
-
-package org.tizen.nfc.page;
-
-import java.io.IOException;
-import java.util.ArrayList;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.tizen.common.connection.ConnectionPlugin;
-import org.tizen.common.connection.ConnectionPlugin.ISelectionListener;
-import org.tizen.common.connection.ui.TizenRemoteFileDialog;
-import org.tizen.common.connection.ui.TizenRemoteFileDialog.TizenRemoteFileDialogResult;
-import org.tizen.injector.provider.AbstractInjectorItem;
-import org.tizen.injector.provider.AbstractInjectorPage;
-import org.tizen.injector.view.InjectorView;
-import org.tizen.sdblib.FileListingService.FileEntry;
-import org.tizen.sdblib.IDevice;
-import org.tizen.sdblib.MultiLineReceiver;
-import org.tizen.sdblib.SdbCommandRejectedException;
-import org.tizen.sdblib.ShellCommandUnresponsiveException;
-import org.tizen.sdblib.TimeoutException;
-
-public class NfcPage extends AbstractInjectorPage implements ISelectionListener
-{
-       // add NDEFMessage
-       private String[] RecordFormatList       = RecordFormat.getInstance().getList();
-       private String[] TypeNameList           = TypeName.getInstance().getList();
-       private Combo cmbRecordFormat;
-       private Combo cmbRecordTypeName;
-       private Text txtRecordTypeName;
-       private Text txtRecordID;
-       private Text txtRecordPayload;
-       private Button butSelectMediaFile;
-
-       // check invalid characters
-       private NDEFRecord oldRecord = new NDEFRecord(0, "", "", "");
-       private boolean bCheckTypeNameText = true;
-       private boolean bCheckIDText = true;
-       private boolean bCheckPayloadText = true;
-
-       private Button butRecordAdd;
-       private Button butRecordEdit;
-       private Button butRecordRemove;
-
-       private Label lblRecords;
-       private int nTotalLength = 0;
-       private final int nMaxNDFEMessageLength = 4096;
-       private Combo cmbRecordList;
-       private ArrayList<NDEFRecord> RecordList = new ArrayList<NDEFRecord>();
-
-       // add Tag
-       private String[] TagTypeList = TagType.getInstance().getList();
-       private Combo cmbTagTypeList;
-       private Button butTagAttach;
-       private Button butTagDetach;
-
-       // add P2P
-       private Button butP2PDiscover;
-       private Button butP2PSend;
-       private Button butP2PDetach;
-
-       private IDevice currentDevice;
-       private Shell shell = null;
-
-       public NfcPage(AbstractInjectorItem item, String name)
-       {
-               super(item, name);
-       }
-
-       @Override
-       protected void createContents()
-       {
-               InjectorView.getDefault().addSelectionListener(this);
-               currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
-
-               shell = parent.getShell();
-
-               createNDEFMessageSection();
-               createTagSection();
-               createP2PSection();
-
-               boolean connected = checkDeviceConnectedAlready();
-               if (connected == true) {
-                       connect();
-               }
-       }
-
-       private void createNDEFMessageSection()
-       {
-               Composite client = formUtil.createSection(parent, "NDEF Message");
-               Composite messageComposite = formUtil.createComposite(client);
-
-               createRecordComposite(messageComposite);
-
-               Composite buttonComposite = formUtil.createComposite(messageComposite,
-                               3);
-               butRecordAdd = formUtil.createButton(buttonComposite, "Add", SWT.PUSH);
-               butRecordEdit = formUtil
-                               .createButton(buttonComposite, "Edit", SWT.PUSH);
-               butRecordRemove = formUtil.createButton(buttonComposite, "Remove",
-                               SWT.PUSH);
-
-               GridData gd1 = new GridData();
-               gd1.widthHint = 110;
-               butRecordAdd.setLayoutData(gd1);
-               butRecordEdit.setLayoutData(gd1);
-               butRecordRemove.setLayoutData(gd1);
-
-               butRecordAdd.addSelectionListener(new SelectionAdapter() {
-                       public void widgetSelected(SelectionEvent e) {
-                               addRecord();
-                       }
-               });
-               butRecordEdit.addSelectionListener(new SelectionAdapter() {
-                       public void widgetSelected(SelectionEvent e) {
-                               editRecord();
-                       }
-               });
-               butRecordRemove.addSelectionListener(new SelectionAdapter() {
-                       public void widgetSelected(SelectionEvent e) {
-                               removeRecord();
-                       }
-               });
-
-               Composite RecordComposite = formUtil.createComposite(messageComposite, 2);
-               GridData gd2 = new GridData();
-               gd2.widthHint = 160;
-               lblRecords = formUtil.createLabel(RecordComposite, String.format("Records [0/%d] ", nMaxNDFEMessageLength));
-               lblRecords.setLayoutData(gd2);
-
-               cmbRecordList = formUtil.createCombo(RecordComposite);
-               cmbRecordList.setLayoutData(gd2);
-               cmbRecordList.addSelectionListener(new SelectionAdapter() {
-                       public void widgetSelected(SelectionEvent e) {
-                               selectRecord();
-                       }
-               });
-       }
-
-       private void createRecordComposite(Composite parent)
-       {
-               GridData gd1 = new GridData();
-               gd1.widthHint = 200;
-
-               Composite messageComposite = formUtil.createComposite(parent, 2);
-
-               formUtil.createLabel(messageComposite, "Type Name Format ");
-               cmbRecordFormat = formUtil.createCombo(messageComposite);
-               cmbRecordFormat.setLayoutData(gd1);
-               formUtil.addComboItem(cmbRecordFormat, RecordFormatList);
-               cmbRecordFormat.addSelectionListener(new SelectionAdapter() {
-                       public void widgetSelected(SelectionEvent e) {
-                               Selected(e);
-                       }
-
-                       public void widgetDefaultSelected(SelectionEvent e) {
-                               Selected(e);
-                       }
-
-                       private void Selected(SelectionEvent e) {
-                               int i = cmbRecordFormat.getSelectionIndex();
-                               if (i != -1) {
-                                       checkRecordFormat(i + 1);
-                                       txtRecordTypeName.setText("");
-                                       cmbRecordTypeName.select(0);
-                                       txtRecordID.setText("");
-                                       txtRecordPayload.setText("");
-                               }
-                       }
-               });
-
-               formUtil.createLabel(messageComposite, "Type Name ");
-               txtRecordTypeName = formUtil.createText(messageComposite, "");
-               txtRecordTypeName.setEnabled(false);
-               txtRecordTypeName.setLayoutData(gd1);
-               txtRecordTypeName.setTextLimit(250);
-               txtRecordTypeName.addModifyListener(new ModifyListener() {
-                       public void modifyText(ModifyEvent e) {
-                               if (bCheckTypeNameText == false) {
-                                       bCheckTypeNameText = true;
-                                       return;
-                               }
-                               if (checkInvalidCharaters(txtRecordTypeName.getText()) == false) {
-                                       txtRecordTypeName.setText(oldRecord.getTypeName());
-                                       return;
-                               }
-                               oldRecord.setTypeName(txtRecordTypeName.getText());
-                       }
-               });
-
-               formUtil.createLabel(messageComposite, "");
-               cmbRecordTypeName = formUtil.createCombo(messageComposite);
-               formUtil.addComboItem(cmbRecordTypeName, TypeNameList);
-               cmbRecordTypeName.setEnabled(false);
-               cmbRecordTypeName.setLayoutData(gd1);
-
-               formUtil.createLabel(messageComposite, "ID ");
-               txtRecordID = formUtil.createText(messageComposite, "");
-               txtRecordID.setEnabled(false);
-               txtRecordID.setLayoutData(gd1);
-               txtRecordID.setTextLimit(250);
-               txtRecordID.addModifyListener(new ModifyListener() {
-                       public void modifyText(ModifyEvent e) {
-                               if (bCheckIDText == false) {
-                                       bCheckIDText = true;
-                                       return;
-                               }
-                               if (checkInvalidCharaters(txtRecordID.getText()) == false) {
-                                       txtRecordID.setText(oldRecord.getId());
-                                       return;
-                               }
-                               oldRecord.setId(txtRecordID.getText());
-                       }
-               });
-
-               formUtil.createLabel(messageComposite, "Payload ");
-               txtRecordPayload = formUtil.createText(messageComposite, "");
-               txtRecordPayload.setEnabled(false);
-               txtRecordPayload.setLayoutData(gd1);
-               txtRecordPayload.setTextLimit(1024);
-               txtRecordPayload.addModifyListener(new ModifyListener() {
-                       public void modifyText(ModifyEvent e) {
-                               if (bCheckPayloadText == false) {
-                                       bCheckPayloadText = true;
-                                       return;
-                               }
-                               if (checkInvalidCharaters(txtRecordPayload.getText()) == false) {
-                                       txtRecordPayload.setText(oldRecord.getPayload());
-                                       return;
-                               }
-                               oldRecord.setPayload(txtRecordPayload.getText());
-                       }
-               });
-
-               formUtil.createLabel(messageComposite, "");
-               butSelectMediaFile = formUtil.createButton(messageComposite,
-                               "Select Media File", SWT.PUSH);
-               butSelectMediaFile.setEnabled(false);
-               butSelectMediaFile.setLayoutData(new GridData(GridData.END,
-                               GridData.END, false, false));
-               butSelectMediaFile.addSelectionListener(new SelectionAdapter() {
-                       public void widgetSelected(SelectionEvent e) {
-                               selectMediaFile();
-                       }
-               });
-       }
-
-       private void createTagSection()
-       {
-               Composite client = formUtil.createSection(parent, "NFC Tag");
-               Composite mainComposite = formUtil.createComposite(client, 3);
-
-               formUtil.createLabel(mainComposite, "Tag Type ");
-               cmbTagTypeList = formUtil.createCombo(mainComposite);
-               GridData gd1 = new GridData();
-               gd1.widthHint = 180;
-               cmbTagTypeList.setLayoutData(gd1);
-               formUtil.addComboItem(cmbTagTypeList, TagTypeList, TagTypeList[0]);
-
-               GridData gd2 = new GridData();
-               gd2.widthHint = 100;
-
-               butTagAttach = formUtil.createButton(mainComposite, "Tag Attach", SWT.PUSH);
-               butTagAttach.setLayoutData(gd2);
-
-               formUtil.createLabel(mainComposite, "");
-               formUtil.createLabel(mainComposite, "");
-               butTagDetach = formUtil.createButton(mainComposite, "Tag Detach", SWT.PUSH);
-               butTagDetach.setLayoutData(gd2);
-               butTagDetach.setEnabled(false);
-
-               butTagAttach.addSelectionListener(new SelectionAdapter() {
-                       public void widgetSelected(SelectionEvent e) {
-                               clickTagDiscovered();
-                       }
-               });
-
-               butTagDetach.addSelectionListener(new SelectionAdapter() {
-                       public void widgetSelected(SelectionEvent e) {
-                               clickTagDetached();
-                       }
-               });
-       }
-
-       private void createP2PSection()
-       {
-               Composite client = formUtil.createSection(parent, "Peer to Peer");
-               Composite mainComposite = formUtil.createComposite(client, 2);
-
-               butP2PDiscover = formUtil.createButton(mainComposite, "P2P Discovered", SWT.PUSH);
-               butP2PDetach = formUtil.createButton(mainComposite, "P2P Detached", SWT.PUSH);
-               butP2PSend = formUtil.createButton(mainComposite, "P2PSend", SWT.PUSH);
-               
-               // TODO
-               butP2PDiscover.setEnabled(true);
-               butP2PDetach.setEnabled(false);
-               butP2PSend.setEnabled(false);
-               //
-
-               GridData gd = new GridData();
-               gd.widthHint = 170;
-               butP2PDiscover.setLayoutData(gd);
-               butP2PDetach.setLayoutData(gd);
-               butP2PSend.setLayoutData(gd);
-
-               butP2PDiscover.addSelectionListener(new SelectionAdapter() {
-                       public void widgetSelected(SelectionEvent e)
-                       {
-                               clickP2PDiscovered();
-                       }
-               });
-
-               butP2PDetach.addSelectionListener(new SelectionAdapter() {
-                       public void widgetSelected(SelectionEvent e)
-                       {
-                               clickP2PDetached();
-                       }
-               });
-
-               butP2PSend.addSelectionListener(new SelectionAdapter() {
-                       public void widgetSelected(SelectionEvent e)
-                       {
-                               clickP2PSend();
-                       }
-               });
-       }
-
-       private void selectRecord() {
-               int i = cmbRecordList.getSelectionIndex();
-               if (i != -1) {
-                       NDEFRecord record = RecordList.get(i);
-                       checkRecordFormat(record.getFormat());
-                       cmbRecordFormat.select(record.getFormat() - 1);
-
-                       if (record.getFormat() == 1) {
-                               if (record.getTypeName().compareTo("U") == 0)
-                                       cmbRecordTypeName.select(0);
-                               else
-                                       cmbRecordTypeName.select(1);
-                               txtRecordTypeName.setText("");
-                       } else {
-                               cmbRecordTypeName.select(0);
-                               txtRecordTypeName.setText(record.getTypeName());
-                       }
-
-                       txtRecordID.setText(record.getId());
-                       txtRecordPayload.setText(record.getPayload());
-               }
-       }
-
-       private boolean checkInvalidCharaters(String text)
-       {
-               char[] textArray = new char[1000];
-               text.getChars(0, text.length(), textArray, 0);
-
-               for (int i = 0; i < text.length(); i++) {
-                       char c = textArray[i];
-                       if (c == '\n') {
-                               NfcDialog.openInfoDialog(shell, "Can not enter a newline character.");
-                               return false;
-                       }
-                       
-                       if (c == ',') {
-                               NfcDialog.openInfoDialog(shell, "Can not enter ',' character.\nThis character is used separater character.");
-                               return false;
-                       }
-
-                       if (c >= 0x80) {
-                               NfcDialog.openInfoDialog(shell, "Invalid characters are entered.\nOnly ASCII characters can be entered.\n");
-                               return false;
-                       }
-               }
-               return true;
-       }
-
-       private void clickTagDiscovered() {
-               String msg = makeSendMessage(NfcCommand.NFC_TAG_DISCOVERED);
-               if (msg != null) {
-                       sendMessage(msg);
-                       {
-                               cmbRecordFormat.setEnabled(false);
-                               checkRecordFormat(0);
-
-                               cmbRecordList.setEnabled(false);
-                               butRecordAdd.setEnabled(false);
-                               butRecordEdit.setEnabled(false);
-                               butRecordRemove.setEnabled(false);
-
-                               cmbTagTypeList.setEnabled(false);
-                               butTagAttach.setEnabled(false);
-                               butTagDetach.setEnabled(true);
-                               
-                               butP2PDiscover.setEnabled(false);
-                               butP2PDetach.setEnabled(false);
-                               butP2PSend.setEnabled(false);
-                       }
-               }
-       }
-
-       private void clickTagDetached() {
-               String msg = makeSendMessage(NfcCommand.NFC_TAG_DETACHED);
-               if (msg != null) {
-                       sendMessage(msg);
-                       {
-                               cmbRecordFormat.setEnabled(true);
-
-                               checkRecordFormat(cmbRecordFormat.getSelectionIndex() + 1);
-                               txtRecordTypeName.setText("");
-                               cmbRecordTypeName.select(0);
-                               txtRecordID.setText("");
-                               txtRecordPayload.setText("");
-
-                               cmbRecordList.setEnabled(true);
-                               butRecordAdd.setEnabled(true);
-                               butRecordEdit.setEnabled(true);
-                               butRecordRemove.setEnabled(true);
-
-                               cmbTagTypeList.setEnabled(true);
-                               butTagAttach.setEnabled(true);
-                               butTagDetach.setEnabled(false);
-                               
-                               butP2PDiscover.setEnabled(true);
-                               butP2PDetach.setEnabled(false);
-                               butP2PSend.setEnabled(false);
-                       }
-               }
-       }
-
-       private void clickP2PDiscovered() {
-               String msg = makeSendMessage(NfcCommand.NFC_P2P_DISCOVERED);
-               if (msg != null) {
-                       sendMessage(msg);
-                       {
-                               cmbTagTypeList.setEnabled(false);
-                               butTagAttach.setEnabled(false);
-                               butTagDetach.setEnabled(false);
-                               
-                               butP2PDiscover.setEnabled(false);
-                               butP2PDetach.setEnabled(true);
-                               butP2PSend.setEnabled(true);
-                       }       
-               }
-               
-       }
-       
-       private void clickP2PDetached() {
-               String msg = makeSendMessage(NfcCommand.NFC_P2P_DETACHED);
-               if (msg != null) {
-                       sendMessage(msg);
-                       {
-                               cmbRecordFormat.setEnabled(true);
-
-                               checkRecordFormat(cmbRecordFormat.getSelectionIndex() + 1);
-                               txtRecordTypeName.setText("");
-                               cmbRecordTypeName.select(0);
-                               txtRecordID.setText("");
-                               txtRecordPayload.setText("");
-
-                               cmbRecordList.setEnabled(true);
-                               butRecordAdd.setEnabled(true);
-                               butRecordEdit.setEnabled(true);
-                               butRecordRemove.setEnabled(true);
-
-                               cmbTagTypeList.setEnabled(true);
-                               butTagAttach.setEnabled(true);
-                               butTagDetach.setEnabled(false);
-                               
-                               butP2PDiscover.setEnabled(true);
-                               butP2PDetach.setEnabled(false);
-                               butP2PSend.setEnabled(false);
-                       }
-               }
-       }
-
-       private void clickP2PSend() {
-               String msg = makeSendMessage(NfcCommand.NFC_P2P_SEND);
-               if (msg != null) {
-                       sendMessage(msg);
-                       cmbRecordFormat.setEnabled(false);
-                       checkRecordFormat(0);
-
-                       cmbRecordList.setEnabled(false);
-                       butRecordAdd.setEnabled(false);
-                       butRecordEdit.setEnabled(false);
-                       butRecordRemove.setEnabled(false);
-
-                       cmbTagTypeList.setEnabled(false);
-                       butTagAttach.setEnabled(false);
-                       butTagDetach.setEnabled(false);
-
-                       butP2PDiscover.setEnabled(false);
-                       butP2PDetach.setEnabled(true);
-                       butP2PSend.setEnabled(false);
-               }
-       }
-
-       private void checkRecordFormat(int format)
-       {
-               switch (format) {
-               case 0: // NDEF_TNF_EMPTY
-                       cmbRecordTypeName.setEnabled(false);
-                       txtRecordTypeName.setEnabled(false);
-                       txtRecordID.setEnabled(false);
-                       txtRecordPayload.setEnabled(false);
-                       butSelectMediaFile.setEnabled(false);
-                       break;
-               case 1: // NDEF_TNF_WELL_KNOWN
-                       cmbRecordTypeName.setEnabled(true);
-                       cmbRecordTypeName.select(0);
-                       txtRecordTypeName.setEnabled(false);
-                       txtRecordID.setEnabled(true);
-                       txtRecordPayload.setEnabled(true);
-                       txtRecordPayload.setEditable(true);
-                       butSelectMediaFile.setEnabled(false);
-                       break;
-               case 2: // NDEF_TNF_MIME_MEDIA
-                       cmbRecordTypeName.setEnabled(false);
-                       txtRecordTypeName.setEnabled(false);
-                       txtRecordTypeName.setEditable(false);
-                       txtRecordID.setEnabled(true);
-                       txtRecordPayload.setEnabled(false);
-                       txtRecordPayload.setEditable(false);
-                       butSelectMediaFile.setEnabled(true);
-                       break;
-               case 3: // NDEF_TNF_ABSOLUTE_URI
-               case 4: // NDEF_TNF_EXTERNAL
-                       cmbRecordTypeName.setEnabled(false);
-                       txtRecordTypeName.setEnabled(true);
-                       txtRecordTypeName.setEditable(true);
-                       txtRecordID.setEnabled(true);
-                       txtRecordPayload.setEnabled(true);
-                       txtRecordPayload.setEditable(true);
-                       butSelectMediaFile.setEnabled(false);
-                       break;
-               case 5: // NDEF_TNF_UNKNOWN
-                       cmbRecordTypeName.setEnabled(false);
-                       txtRecordTypeName.setEnabled(false);
-                       txtRecordID.setEnabled(true);
-                       txtRecordPayload.setEnabled(true);
-                       txtRecordPayload.setEditable(true);
-                       butSelectMediaFile.setEnabled(false);
-                       break;
-               }
-               bCheckTypeNameText = false;
-               bCheckIDText = false;
-               bCheckPayloadText = false;
-       }
-
-       private void addRecord()
-       {
-               if (RecordList.size() >= 5) {
-                       NfcDialog.openInfoDialog(shell, "The number of NDEF records has reached the maximum limit of 5.\n");
-                       return;
-               }
-
-               NDEFRecord record = new NDEFRecord();
-
-               /*
-               // check duplicate id !!
-               if (cmbRecordFormat.getSelectionIndex() != 0) {
-                       if (!checkRecordID(txtRecordID.getText() != null ? txtRecordID.getText() : "Null")) {
-                               return;
-                       }
-               }
-               */
-
-               setRecordValue(record);
-               RecordList.add(record);
-               if (!checkRecordlistMaxLength()) {
-                       RecordList.remove(record);
-                       return;
-               }
-
-               lblRecords.setText(String.format("Records [%4d/%d] ", nTotalLength, nMaxNDFEMessageLength));
-               cmbRecordList.add("record item" + RecordList.indexOf(record));
-               cmbRecordList.clearSelection();
-       }
-
-       private void editRecord()
-       {
-               int i = cmbRecordList.getSelectionIndex();
-               if (i != -1) {
-                       NDEFRecord record = RecordList.get(i);
-                       /*
-                       // check duplicate id !!
-                       if (record.getFormat() != 0) {
-                               if (!checkRecordID(txtRecordID.getText() != null ? txtRecordID.getText() : "Null", i)) {
-                                       return;
-                               }
-                       }
-                       */
-
-                       NDEFRecord copyRecord = record;
-                       setRecordValue(record);
-
-                       if (!checkRecordlistMaxLength()) {
-                               record = copyRecord;
-                               return;
-                       }
-
-                       lblRecords.setText(String.format("Records [%4d/%d] ",   nTotalLength, nMaxNDFEMessageLength));
-                       // cmbRecordFormat.select(record.getFormat());
-                       // checkFormat(record.getFormat());
-               }
-       }
-
-       private void removeRecord()
-       {
-               int index = cmbRecordList.getSelectionIndex();
-               if (index != -1) {
-                       RecordList.remove(index);
-                       cmbRecordList.removeAll();
-                       for (int i = 0; i < RecordList.size(); i++) {
-                               cmbRecordList.add("record item" + i);
-                       }
-                       cmbRecordList.clearSelection();
-               }
-
-               checkRecordlistMaxLength();
-               lblRecords.setText(String.format("Records [%4d/%d] ", nTotalLength, nMaxNDFEMessageLength));
-               txtRecordTypeName.setText("");
-               cmbRecordTypeName.select(0);
-               txtRecordID.setText("");
-               txtRecordPayload.setText("");
-       }
-
-       private void setRecordValue(NDEFRecord record)
-       {
-               record.setFormat(cmbRecordFormat.getSelectionIndex() + 1);
-
-               if ((cmbRecordFormat.getSelectionIndex() + 1) == 1) {
-                       record.setTypeName(TypeNameList[cmbRecordTypeName.getSelectionIndex()]);
-               } else {
-                       if (txtRecordTypeName.getText().isEmpty() == true)
-                               record.setTypeName("Null");
-                       else
-                               record.setTypeName(txtRecordTypeName.getText());
-               }
-
-               if (txtRecordID.getText().isEmpty() == true)
-                       record.setId("Null");
-               else
-                       record.setId(txtRecordID.getText());
-
-               if (txtRecordPayload.getText().isEmpty() == true)
-                       record.setPayload("Null");
-               else
-                       record.setPayload(txtRecordPayload.getText());
-       }
-
-/*
-       private boolean checkRecordID(String id)
-       {
-               for (NDEFRecord record : RecordList) {
-                       if (id.equals(record.getId())) {
-                               NfcDialog.openInfoDialog(shell, "Duplicate ID is not allowed.\n");
-                               return false;
-                       }
-               }
-
-               return true;
-       }
-
-       private boolean checkRecordID(String id, int except)
-       {
-               NDEFRecord record;
-               for (int i = 0; i < RecordList.size(); i++) {
-                       if (i == except)
-                               continue;
-
-                       record = RecordList.get(i);
-                       if (id.equals(record.getId())) {
-                               NfcDialog.openInfoDialog(shell, "Duplicate ID is not allowed.\n");
-                               return false;
-                       }
-               }
-
-               return true;
-
-       }
-*/
-
-       private boolean checkRecordlistMaxLength()
-       {
-               int lenList = 0;
-
-               for (NDEFRecord record : RecordList) {
-                       lenList += 1 + record.getTypeName().length()
-                                   + record.getId().length() + record.getPayload().length() + 4;
-               }
-
-               if (lenList > nMaxNDFEMessageLength) {
-                       NfcDialog.openInfoDialog(shell, String.format("The length of the NDEF message has reached the maxium limit of %d bytes\n", nMaxNDFEMessageLength));
-                       return false;
-               }
-
-               nTotalLength = lenList;
-
-               return true;
-       }
-
-       private static String MediaFilePath = null;
-       private String shellCmd    = null;
-       private String shellResult = null;
-
-       private void selectMediaFile()
-       {
-               MediaFilePath = null;
-               if (shell != null) {
-                       shell.getDisplay().syncExec(new Runnable() {
-                               public void run() {
-                                       TizenRemoteFileDialog dlg = new TizenRemoteFileDialog(
-                                                       shell, "Select a media file", currentDevice, false,
-                                                       "/opt/nfc");
-                                       if (dlg.open() == TizenRemoteFileDialogResult.OK) {
-                                               FileEntry fileEntry = dlg.getSelectedFileEntry();
-                                               MediaFilePath = fileEntry.getFullPath();
-                                       }
-                               }
-                       });
-               } else {
-                       NfcDialog.openErrorDialog("Can not open emulator's file dialog.\n");
-               }
-
-               if (MediaFilePath == null) {
-                       NfcDialog.openErrorDialog(shell, "Please choose media file.\n");
-               } else {
-                       String type = null;
-                       type = checkFileType(MediaFilePath);
-                       if (type == null) {
-                               NfcDialog.openErrorDialog(shell, "Type of selected file is not mime media type.\n");
-                               return;
-                       }
-                       if (checkFileSize(MediaFilePath) == false) {
-                               NfcDialog.openErrorDialog(shell, "Size of selected file is too big. Available file size is under of 10KB.\n");
-                               return;
-                       }
-                       txtRecordTypeName.setEnabled(true);
-                       txtRecordTypeName.setEditable(false);
-                       txtRecordPayload.setEnabled(true);
-                       txtRecordPayload.setEditable(false);
-                       txtRecordTypeName.setText(type);
-                       txtRecordPayload.setText(MediaFilePath);
-               }
-       }
-
-       private String checkFileType(String filePath) {
-               int index   = filePath.lastIndexOf('.');
-               String type = null;
-               if (index != -1) {
-                       String ex = filePath.substring(index + 1);
-                       MimeTypeList typelist = MimeTypeList.getInstance();
-
-                       type = typelist.findMimeType(ex);
-               }
-               return type;
-       }
-
-       private boolean checkFileSize(String filePath) {
-               boolean result = false;
-               shellCmd    = "du " + filePath;
-               try {
-                       currentDevice.executeShellCommand(shellCmd, new MultiLineReceiver() {
-                               @Override
-                               public void processNewLines(String[] lines) {
-                                       shellResult = lines[0];
-                               }
-                               
-                       });
-               } catch (TimeoutException e) {
-                       errorSelectMediaFile(e);
-                       return result;
-               } catch (SdbCommandRejectedException e) {
-                       errorSelectMediaFile(e);
-                       return result;
-               } catch (ShellCommandUnresponsiveException e) {
-                       errorSelectMediaFile(e);
-                       return result;
-               } catch (IOException e) {
-                       errorSelectMediaFile(e);
-                       return result;
-               }
-               if (shellResult != null) {
-                       int index = shellResult.indexOf('\t');
-                       if (index != -1) {
-                               shellResult = shellResult.substring(0, index);
-                               
-                               if (Integer.valueOf(shellResult) <= 10) {
-                                       result = true;
-                               }
-                       }
-               }
-               return result;
-       }
-
-       private void errorSelectMediaFile(Exception e) {
-               NfcDialog.openErrorDialog(shell, String.format("Throw exception while select media file : %s\n", e.getMessage()));
-       }
-
-       private String makeSendMessage(Integer type)
-       {
-               String msg = null;
-               switch (type) {
-               case 100: // NFC_TAG_DISCOVERED
-               {
-                       int tagtype = cmbTagTypeList.getSelectionIndex();
-                       if (tagtype != -1 && tagtype != 0) {
-                               String records = new String();
-                               records += "," + RecordList.size();
-                               for (NDEFRecord record : RecordList) {
-                                       records += "," + record.getFormat() + ","
-                                                       + record.getTypeName() + "," + record.getId() + ","
-                                                       + record.getPayload();
-                               }
-
-                               msg = NfcCommand.NFC_TAG_DISCOVERED.toString() + ":"
-                                               + String.valueOf(tagtype) + records + "\n";
-
-                       } else {
-                               NfcDialog.openErrorDialog(shell, "Select Tag Type\n");
-                               return null;
-                       }
-               }
-                       break;
-               case 101: // NFC_TAG_DETACHED
-                       msg = NfcCommand.NFC_TAG_DETACHED.toString() + ":" + "\n";
-                       break;
-               case 102: // NFC_P2P_DISCOVERED
-                       msg = NfcCommand.NFC_P2P_DISCOVERED.toString() + ":\n";
-                       break;
-               case 103: // NFC_P2P_DETACHED
-                       msg = NfcCommand.NFC_P2P_DETACHED.toString() + ":\n";
-                       break;
-               case 104: // NFC_P2P_SEND
-               {
-                       int tagtype = 5;        // for peer to peer
-                       String records = new String();
-                       records += "," + RecordList.size();
-                       for (NDEFRecord record : RecordList) {
-                               records += "," + record.getFormat() + ","
-                                               + record.getTypeName() + "," + record.getId() + ","
-                                               + record.getPayload();
-                       }
-
-                       msg = NfcCommand.NFC_P2P_SEND.toString() + ":"
-                               + String.valueOf(tagtype) + records + "\n";
-               }
-                       break;
-               }
-
-               return msg;
-       }
-
-       public boolean sendMessage(String msg)
-       {
-               boolean result = false;
-               try {
-                       // add for test
-                       //NfcDialog.openInfoDialog(shell, msg); 
-                       result = injectorSocket.sendNfc(msg);
-               } catch (Exception e1) {
-                       // TODO Auto-generated catch block
-                       e1.printStackTrace();
-               }
-
-               return result;
-       }
-
-       private boolean checkDeviceConnectedAlready()
-       {
-               if (currentDevice == null)
-                       return false;
-               else
-                       return true;
-       }
-
-       @Override
-       protected void registerReceivers()
-       {
-               // TODO Auto-generated method stub
-
-       }
-
-       // @Override
-       public void connect()
-       {
-               // TODO Auto-generated method stub
-               currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
-       }
-
-       // @Override
-       public void disconnect()
-       {
-               // TODO Auto-generated method stub
-       }
-
-       @Override
-       protected void finalize() throws Throwable
-       {
-               InjectorView.getDefault().removeSelectionListener(this);
-               // TargetConnectionControl.removeTargetConnectionListener(this);
-               super.finalize();
-       }
-
-       @Override
-       public void selectionChanged(FileEntry selectedEntry)
-       {
-               if (selectedEntry == null) {
-                       disconnect();
-                       return;
-               } else if (!selectedEntry.getFileListingService().getDevice()
-                               .isEmulator())
-                       return;
-
-               if(currentDevice == null && selectedEntry.getName() != null) {
-                       connect();
-               } else if(currentDevice == null && selectedEntry.getName() == null) {
-                       return;
-               } else if (currentDevice.getSerialNumber() != selectedEntry.getName()) {
-                       disconnect();
-                       connect();
-               }
-       }
-}
\ No newline at end of file
diff --git a/org.tizen.sensor.accelerometer/.project b/org.tizen.sensor.accelerometer/.project
deleted file mode 100644 (file)
index 8caeef0..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-       <name>org.tizen.sensor.accelerometer</name>
-       <comment></comment>
-       <projects>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>org.eclipse.jdt.core.javabuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.ManifestBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.SchemaBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>org.eclipse.pde.PluginNature</nature>
-               <nature>org.eclipse.jdt.core.javanature</nature>
-       </natures>
-</projectDescription>
diff --git a/org.tizen.sensor.light/.project b/org.tizen.sensor.light/.project
deleted file mode 100644 (file)
index d5448fc..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-       <name>org.tizen.sensor.light</name>
-       <comment></comment>
-       <projects>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>org.eclipse.jdt.core.javabuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.ManifestBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.SchemaBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>org.eclipse.pde.PluginNature</nature>
-               <nature>org.eclipse.jdt.core.javanature</nature>
-       </natures>
-</projectDescription>
diff --git a/org.tizen.sensor.light/src/org/tizen/sensor/light/page/LightPage.java b/org.tizen.sensor.light/src/org/tizen/sensor/light/page/LightPage.java
deleted file mode 100644 (file)
index 9c1ff1d..0000000
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * org.tizen.sensor.light
- * 
- * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Sungmin Ha <sungmin82.ha@samsung.com>
- * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
- * DongKyun Yun <dk77.yun@samsung.com>
- *
- * 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.
- * 
- * Contributors:
- * - S-Core Co., Ltd
- * 
- */
-
-package org.tizen.sensor.light.page;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Slider;
-import org.eclipse.swt.widgets.Text;
-
-import org.tizen.common.connection.ConnectionPlugin;
-import org.tizen.common.connection.ConnectionPlugin.ISelectionListener;
-import org.tizen.common.util.DialogUtil;
-import org.tizen.sdblib.FileListingService.FileEntry;
-import org.tizen.sdblib.IDevice;
-import org.tizen.injector.protocol.sensor.TestSensorMessage;
-import org.tizen.injector.provider.AbstractInjectorItem;
-import org.tizen.injector.provider.AbstractInjectorPage;
-import org.tizen.injector.view.InjectorView;
-
-public class LightPage extends AbstractInjectorPage implements ISelectionListener {
-       private Text sliderText;
-       private Text luxText;
-       private Button injectLux;
-       private Slider slider;
-       private final String sensorNumber = "3\n";
-       private final String lightLevel = "Level";
-       private int luxData = 65535, levelData;
-       private IDevice currentDevice;
-       
-       public LightPage(AbstractInjectorItem item, String name) {
-               super(item, name);
-       }
-
-       public static boolean checkNumberFormat(String noStr) {
-               Pattern luxPattern = Pattern.compile( "[^0-9]");
-               Matcher matcher = luxPattern.matcher(noStr);
-               return matcher.find();
-       }
-       
-       @Override
-       protected void createContents() {
-               InjectorView.getDefault().addSelectionListener(this);
-               currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
-               
-//             Composite mainComposite = formUtil.createComposite(parent, 3);                  
-//             formUtil.createLabel(mainComposite, lightLevel);
-//             slider = formUtil.createSlider(mainComposite, SWT.HORIZONTAL);
-//             slider.setValues(10, 1, 11, 1, 1, 1);
-//             slider.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
-//             sliderText = formUtil.createText(mainComposite, Integer.toString(slider.getSelection()));
-//             sliderText.setEditable(false);
-//             GridData gd = new GridData(GridData.BEGINNING, GridData.CENTER, false, false);
-//             gd.widthHint = 20;
-//             sliderText.setLayoutData(gd);
-//             levelData = slider.getSelection();
-//             slider.addSelectionListener(new SelectionListener() {
-//                     @Override
-//                     public void widgetDefaultSelected(SelectionEvent e) {
-//                             // TODO Auto-generated method stub
-//                     }
-//                     @Override
-//                     public void widgetSelected(SelectionEvent e) {
-//                             levelData = slider.getSelection();
-//                             sliderText.setText(Integer.toString(levelData));
-//                             sendMessage(1, levelData);
-//                     }
-//             });
-               
-               Composite mainComposite2 = formUtil.createComposite(parent, 100);
-               formUtil.createLabel(mainComposite2, "Lux  ");
-               luxText = formUtil.createText(mainComposite2, "");
-               luxText.setTextLimit(5);
-
-               Composite buttonComposite = formUtil.createComposite(mainComposite2);
-               injectLux = formUtil.createButton(buttonComposite, "Inject", SWT.PUSH);
-               injectLux.addSelectionListener(new SelectionAdapter(){
-                       @Override
-                       public void widgetSelected(SelectionEvent e) {
-                               String number = luxText.getText().trim();
-                               if(number==null||number.length()==0)
-                                       return;
-                               
-                               if(checkNumberFormat(number) || Double.parseDouble(number) <= 0 || Double.parseDouble(number) > 65535)
-                               {       
-                                               DialogUtil.openMessageDialog("Please enter the correct value.\nLux can be entered in the range of 1 to 65535.");
-                                               return;
-                               }
-                               luxData = Integer.parseInt(number);
-                               sendMessage(2, luxData);
-                               
-                               levelData = (luxData / 6554) % 10 + 1; 
-                               sendMessage(1, levelData);
-                       }
-               });
-               
-               boolean connected = checkDeviceConnectedAlready();
-               if (connected == true) {
-                       connect();
-               }
-       }
-
-       private boolean checkDeviceConnectedAlready() {
-               if (currentDevice == null)
-                       return false;
-               else
-                       return true;
-       }
-       
-       @Override
-       protected void registerReceivers() {
-               // TODO Auto-generated method stub
-               
-       }
-       
-       public void sendMessage(int label, int data) {
-                       TestSensorMessage msg = new TestSensorMessage(label, data);
-                       try {
-                       //      sensorSocket.send(sensorNumber + msg.getMessage());
-                               injectorSocket.sendSensor(sensorNumber + msg.getMessage());
-                       } catch (Exception e1) {
-                               // TODO Auto-generated catch block
-                               e1.printStackTrace();
-                       }
-       }
-
-//     @Override
-       public void connect() {
-               // TODO Auto-generated method stub
-               currentDevice = ConnectionPlugin.getDefault().getCurrentDevice();
-       }
-
-//     @Override
-       public void disconnect() {
-               // TODO Auto-generated method stub
-       }
-       
-    @Override
-    protected void finalize() throws Throwable {
-       InjectorView.getDefault().removeSelectionListener(this);
-//     TargetConnectionControl.removeTargetConnectionListener(this);
-       super.finalize();
-    }
-
-       @Override
-       public void selectionChanged(FileEntry selectedEntry) {
-               if( selectedEntry == null)
-               {
-                       disconnect();
-                       return;
-               }
-               else if (!selectedEntry.getFileListingService().getDevice().isEmulator())
-                       return;
-               
-               if(currentDevice == null && selectedEntry.getName() != null)
-                       connect();
-               else if(currentDevice == null && selectedEntry.getName() == null)
-                       return;
-               else if (currentDevice.getSerialNumber() != selectedEntry.getName()) {
-                       disconnect();
-                       connect();
-               }
-               sendMessage(1, levelData);
-               sendMessage(2, luxData);
-       }
-}
diff --git a/org.tizen.sensor.motion/.project b/org.tizen.sensor.motion/.project
deleted file mode 100644 (file)
index b4d9e48..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-       <name>org.tizen.sensor.motion</name>
-       <comment></comment>
-       <projects>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>org.eclipse.jdt.core.javabuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.ManifestBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.SchemaBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>org.eclipse.pde.PluginNature</nature>
-               <nature>org.eclipse.jdt.core.javanature</nature>
-       </natures>
-</projectDescription>
diff --git a/org.tizen.sensor.proximity/.project b/org.tizen.sensor.proximity/.project
deleted file mode 100644 (file)
index 58c1bbf..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-       <name>org.tizen.sensor.proximity</name>
-       <comment></comment>
-       <projects>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>org.eclipse.jdt.core.javabuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.ManifestBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.SchemaBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>org.eclipse.pde.PluginNature</nature>
-               <nature>org.eclipse.jdt.core.javanature</nature>
-       </natures>
-</projectDescription>
index b6eaae3..af157fb 100755 (executable)
@@ -9,20 +9,37 @@ __set_parameter()
        build_result_directory=${build_type}.${build_id}
        build_result_path="$build_path/$build_result_directory"
        architecture=x86
-       ide_root_path_name=IDE
-
-       case ${platform} in
-               linux)
-                       archive_platform_name=linux
-                       windowing=gtk
-                       ;;
-               windows)
-                       archive_platform_name=win32
-                       windowing=win32
-                       ;;
-               *)
-                       echo "${platform} is not support yet."
-                       ;;
+       ide_root_path_name=ide
+
+       case ${TARGET_OS} in
+            ubuntu-32)
+                archive_platform_name=linux
+                windowing=gtk
+                architecture=x86
+                ;;
+            windows-32)
+                archive_platform_name=win32
+                windowing=win32
+                architecture=x86
+                ;;
+            ubuntu-64)
+                archive_platform_name=linux
+                windowing=gtk
+                architecture=x86_64
+                ;;
+            windows-64)
+                archive_platform_name=win32
+                windowing=win32
+                architecture=x86_64
+                ;;
+            macos-64)
+                archive_platform_name=macosx
+                windowing=cocoa
+                architecture=x86_64
+                ;;
+            *)
+                echo "${platform} is not support yet."
+               ;;
        esac
 
        result_archive_file=${build_id}-${archive_platform_name}.${windowing}.${architecture}.zip
@@ -30,13 +47,16 @@ __set_parameter()
 
 __set_build_parameter()
 {
-       case ${platform} in
-               linux)
+       case ${TARGET_OS} in
+               ubuntu-32|ubuntu-64)
                        reference_ide_path=${ROOTDIR}/indigo-pde/eclipse
                        ;;
-               windows)
+               windows-32|windows-64)
                        reference_ide_path=${ROOTDIR}/indigo-winpde/eclipse
                        ;;
+               macos-64)
+                       reference_ide_path=${ROOTDIR}/indigo-macpde/eclipse
+                       ;;
                *)
                        echo "${platform} is not support yet."
                        ;;
@@ -77,9 +97,9 @@ __clean_build_environment()
                rm -rf ${build_path}/buildRepo
        fi
 
-       rm -r ${build_path}/*.xml
-       rm -r ${build_path}/*.properties
-       rm -r ${build_path}/*.clean
+       rm -rf ${build_path}/*.xml
+       rm -rf ${build_path}/*.properties
+       rm -rf ${build_path}/*.clean
 
 
        if [ -d $build_path/plugins ]
@@ -106,11 +126,16 @@ __clean_build_environment()
 __copy_build_sources()
 {
        echo "Copy features from $SRCDIR to $build_path/features"
-       cp -r $SRCDIR/*.feature $build_path/features
+       temp_dir="`mktemp -d /tmp/ide.XXXXX`"
+       cp -r $SRCDIR/* $temp_dir
+       cp -r $temp_dir/* $build_path/features
+       rm -rf $temp_dir
 
        echo "Copy plugins from $SRCDIR to $build_path/plugins"
-       cp -r $SRCDIR/* $build_path/plugins
-       rm -rf $build_path/plugins/*.feature
+       temp_dir="`mktemp -d /tmp/ide.XXXXX`"
+       cp -r $SRCDIR/* $temp_dir
+       cp -r $temp_dir/* $build_path/plugins
+       rm -rf $temp_dir
 }
 
 __copy_dependency_plugins()
@@ -176,11 +201,14 @@ __unzip_plugin_pack()
 
 build_plugins()
 {
-       case ${platform} in
-               linux)
+       case ${TARGET_OS} in
+               ubuntu-32|ubuntu-64)
+                       echo "build plugin for ${platform}"
+                       ;;
+               windows-32|windows-64)
                        echo "build plugin for ${platform}"
                        ;;
-               windows)
+               macos-64)
                        echo "build plugin for ${platform}"
                        ;;
                *)
@@ -214,12 +242,8 @@ __clean_packaging_environment()
 
 __copy_necessary_binaries()
 {
-       ## 패키징시 필요한 파일이 있으면 여기에 구현하시면 됩니다.
-       ## 파일을 복사할 위치는 ${INSTALL_DIR} 아래에 원하는 위치로 지정하시면 됩니다.
-       ## INSTALL_DIR의 값은 "${git repository 위치}/package/${package_name}.package.${platform}/data" 로 되어있습니다.
-       ## ex) cp -rf ~~~~/file.file ${INSTALL_DIR}/${ide_root_path_name}/
-       
        echo "add necessary files."
+       ## ex) cp -rf ~~~~/file.file ${INSTALL_DIR}/${ide_root_path_name}/
 }
 
 packaging_plugins()
@@ -244,7 +268,6 @@ packaging_plugins()
 clean()
 {
        echo "=========================================CLEAN============================================"
-       make clean
        rm -rf ${SRCDIR}/*.zip
        rm -rf ${SRCDIR}/*.tar.gz
        rm -rf ${build_path}
@@ -261,7 +284,7 @@ build()
                package_name=`echo ${pkgname_and_platform} | cut -f1 -d " " | cut -f2 -d ":"`
                platform=`echo ${pkgname_and_platform} | cut -f2 -d " " | cut -f2 -d ":"`
        
-               if [ "x${BUILD_TARGET_OS}" = "x${platform}" ]
+               if [ "x${TARGET_OS}" = "x${platform}" ]
                then
                        build_plugins
                else
@@ -281,7 +304,7 @@ install()
                package_name=`echo ${pkgname_and_platform} | cut -f1 -d " " | cut -f2 -d ":"`
                platform=`echo ${pkgname_and_platform} | cut -f2 -d " " | cut -f2 -d ":"`
 
-               if [ "x${BUILD_TARGET_OS}" = "x${platform}" ]
+               if [ "x${TARGET_OS}" = "x${platform}" ]
                then
                        packaging_plugins
                else
diff --git a/package/build.windows b/package/build.windows
deleted file mode 100755 (executable)
index b6eaae3..0000000
+++ /dev/null
@@ -1,296 +0,0 @@
-#!/bin/bash -x
-
-build_path=${SRCDIR}/build_result
-
-__set_parameter()
-{
-       build_id=${package_name}
-       build_type=N
-       build_result_directory=${build_type}.${build_id}
-       build_result_path="$build_path/$build_result_directory"
-       architecture=x86
-       ide_root_path_name=IDE
-
-       case ${platform} in
-               linux)
-                       archive_platform_name=linux
-                       windowing=gtk
-                       ;;
-               windows)
-                       archive_platform_name=win32
-                       windowing=win32
-                       ;;
-               *)
-                       echo "${platform} is not support yet."
-                       ;;
-       esac
-
-       result_archive_file=${build_id}-${archive_platform_name}.${windowing}.${architecture}.zip
-}
-
-__set_build_parameter()
-{
-       case ${platform} in
-               linux)
-                       reference_ide_path=${ROOTDIR}/indigo-pde/eclipse
-                       ;;
-               windows)
-                       reference_ide_path=${ROOTDIR}/indigo-winpde/eclipse
-                       ;;
-               *)
-                       echo "${platform} is not support yet."
-                       ;;
-       esac
-}
-
-__set_install_parameter()
-{
-       INSTALL_DIR=${SRCDIR}/package/${package_name}.package.${platform}/data
-}
-
-__clean_build_environment()
-{
-       if [ -d $build_path ]
-       then
-               echo "Build result directory : [$build_path]"
-       else
-               echo "Make build result directory [$build_path]"
-               mkdir -p $build_path
-       fi
-
-       echo "Remove legacy build files..."
-       if [ -d ${build_result_path}/${archive_platform_name}.${windowing}.${architecture} ]
-       then
-               rm -rf ${build_result_path}/${archive_platform_name}.${windowing}.${architecture}
-       fi
-       if [ -e ${build_result_path}/${result_archive_file} ]
-       then
-               rm -rf ${build_result_path}/${result_archive_file}
-       fi
-       if [ -d ${build_path}/tmp ]
-       then
-               rm -rf ${build_path}/tmp
-       fi
-
-       if [ -d ${build_path}/buildRepo ]
-       then
-               rm -rf ${build_path}/buildRepo
-       fi
-
-       rm -r ${build_path}/*.xml
-       rm -r ${build_path}/*.properties
-       rm -r ${build_path}/*.clean
-
-
-       if [ -d $build_path/plugins ]
-       then
-               echo "plugins directory recreate..."
-               rm -rf $build_path/plugins
-               mkdir $build_path/plugins
-       else
-               echo "Make plugins directory..."
-               mkdir $build_path/plugins
-       fi
-       if [ -d $build_path/features/ ]
-       then
-               echo "features directory recreate..."
-               rm -rf $build_path/features
-               mkdir $build_path/features
-       else
-               echo "Make features directory..."
-               mkdir $build_path/features
-       fi
-
-}
-
-__copy_build_sources()
-{
-       echo "Copy features from $SRCDIR to $build_path/features"
-       cp -r $SRCDIR/*.feature $build_path/features
-
-       echo "Copy plugins from $SRCDIR to $build_path/plugins"
-       cp -r $SRCDIR/* $build_path/plugins
-       rm -rf $build_path/plugins/*.feature
-}
-
-__copy_dependency_plugins()
-{
-       dependency_plugin_path=${ROOTDIR}/${ide_root_path_name}
-       if [ -d ${dependency_plugin_path} ]
-       then
-               cp -rf ${dependency_plugin_path}/features/* ${build_path}/features/
-               cp -rf ${dependency_plugin_path}/plugins/* ${build_path}/plugins/
-       fi
-}
-
-__make_ant_build_properties_file()
-{
-       builder_path="${SRCDIR}/builder"
-       parent_path_of_based_eclipse=${reference_ide_path}/..
-
-       echo "Make build.properties file..."
-       if [ ! -e $builder_path/build.properties.clean ] ; then
-               echo "ERROR : \"build.properties.clean\" file does not exist..."
-               exit 1
-       fi
-       cp $builder_path/build.properties.clean $build_path
-       cp $builder_path/customTargets.xml $build_path
-
-       if [ -d $reference_ide_path ] 
-       then
-               sed -e "s;\(^buildDirectory=\).*;\1${build_path};g" \
-               -e "s;\(^base=\).*;\1${parent_path_of_based_eclipse};g" \
-               -e "s;\(^baseLocation=\).*;\1${reference_ide_path};g" \
-               -e "s;\(^configs=\).*;\1${archive_platform_name},${windowing},${architecture};g" \
-               -e "s;\(^buildType=\).*;\1${build_type};g" \
-               -e "s;\(^buildId=\).*;\1${build_id};g" \
-               -e "s;\(^archivePrefix=\).*;\1${build_id};g" \
-               < $build_path/build.properties.clean > $build_path/build.properties
-
-       else
-               echo "ERROR : target eclipse is not exist."
-               exit 1
-       fi
-}
-
-__execute_pde_build()
-{
-       echo "Execute Product Ant Builder..."
-       equinox_launcher=`echo org.eclipse.equinox.launcher_*.jar`
-       pde_build=`echo org.eclipse.pde.build_*`
-
-       java -XX:+UseParNewGC -jar ${reference_ide_path}/plugins/$equinox_launcher -application org.eclipse.ant.core.antRunner -buildfile ${reference_ide_path}/plugins/$pde_build/scripts/productBuild/productBuild.xml -Dbuilder=$build_path -Dosgi.locking=none 2>&1
-
-       if [ $? != 0 ];
-       then
-               echo "Build failed..."
-               exit 1
-       fi
-}
-
-__unzip_plugin_pack()
-{
-       echo "unzip to $build_result_path"
-       unzip -a $build_result_path/${result_archive_file} -d $build_result_path/${archive_platform_name}.${windowing}.${architecture}
-}
-
-build_plugins()
-{
-       case ${platform} in
-               linux)
-                       echo "build plugin for ${platform}"
-                       ;;
-               windows)
-                       echo "build plugin for ${platform}"
-                       ;;
-               *)
-                       echo "${platform} is not support yet."
-                       exit 1
-                       ;;
-       esac
-
-       __set_parameter
-       __set_build_parameter
-       __clean_build_environment
-       __copy_build_sources
-       __copy_dependency_plugins
-       __make_ant_build_properties_file
-       __execute_pde_build
-       __unzip_plugin_pack
-
-       echo "Build SUCCESS. You will find SDK IDE in \"${build_result_path}\"."
-}
-
-__clean_packaging_environment()
-{
-
-       if [ -d ${INSTALL_DIR} ]
-       then
-               rm -rf ${INSTALL_DIR}
-       else
-               mkdir -p ${INSTALL_DIR}
-       fi
-}
-
-__copy_necessary_binaries()
-{
-       ## 패키징시 필요한 파일이 있으면 여기에 구현하시면 됩니다.
-       ## 파일을 복사할 위치는 ${INSTALL_DIR} 아래에 원하는 위치로 지정하시면 됩니다.
-       ## INSTALL_DIR의 값은 "${git repository 위치}/package/${package_name}.package.${platform}/data" 로 되어있습니다.
-       ## ex) cp -rf ~~~~/file.file ${INSTALL_DIR}/${ide_root_path_name}/
-       
-       echo "add necessary files."
-}
-
-packaging_plugins()
-{
-       __set_parameter
-       __set_install_parameter
-
-       __clean_packaging_environment
-       __copy_necessary_binaries
-
-       install_ide_path=${INSTALL_DIR}/${ide_root_path_name}
-       
-       if [ ! -d ${install_ide_path} ]
-       then
-               mkdir -p ${install_ide_path}
-       fi
-
-       cp -rf ${build_result_path}/${archive_platform_name}.${windowing}.${architecture}/${package_name}/* ${install_ide_path}/
-}
-
-# clean
-clean()
-{
-       echo "=========================================CLEAN============================================"
-       make clean
-       rm -rf ${SRCDIR}/*.zip
-       rm -rf ${SRCDIR}/*.tar.gz
-       rm -rf ${build_path}
-}
-
-# build
-build() 
-{
-       echo "=========================================BUILD============================================"
-       pkgname_and_platform_list=`awk 'BEGIN{RS="\n\n"; FS="\n"} /Package:/{for(i=1;i<NF;i++){if($i ~ /^OS:/){print $1,$i}}}' ${SRCDIR}/package/pkginfo.manifest | tr ' ' '@'`
-       for pkgname_and_platform in ${pkgname_and_platform_list}
-       do
-               pkgname_and_platform=`echo $pkgname_and_platform | tr '@' ' '`
-               package_name=`echo ${pkgname_and_platform} | cut -f1 -d " " | cut -f2 -d ":"`
-               platform=`echo ${pkgname_and_platform} | cut -f2 -d " " | cut -f2 -d ":"`
-       
-               if [ "x${BUILD_TARGET_OS}" = "x${platform}" ]
-               then
-                       build_plugins
-               else
-                       echo ""
-               fi
-       done
-}
-
-# install
-install() 
-{
-       pkgname_and_platform_list=`awk 'BEGIN{RS="\n\n"; FS="\n"} /Package:/{for(i=1;i<NF;i++){if($i ~ /^OS:/){print $1,$i}}}' ${SRCDIR}/package/pkginfo.manifest | tr ' ' '@'`
-       for pkgname_and_platform in ${pkgname_and_platform_list}
-       do
-               echo "=========================================INSTALL============================================"
-               pkgname_and_platform=`echo $pkgname_and_platform | tr '@' ' '`
-               package_name=`echo ${pkgname_and_platform} | cut -f1 -d " " | cut -f2 -d ":"`
-               platform=`echo ${pkgname_and_platform} | cut -f2 -d " " | cut -f2 -d ":"`
-
-               if [ "x${BUILD_TARGET_OS}" = "x${platform}" ]
-               then
-                       packaging_plugins
-               else
-                       echo ""
-               fi
-       done    
-}
-
-[ "$1" = "clean" ] && clean
-[ "$1" = "build" ] && build
-[ "$1" = "install" ] && install
-exit 0
diff --git a/package/changelog b/package/changelog
new file mode 100644 (file)
index 0000000..bfcdc46
--- /dev/null
@@ -0,0 +1,106 @@
+* 0.2.95
+- initialize the earjack status to 0 (disconnect)
+== Sooyoung Ha <yoosah.ha@samsung.com> 2013-06-29
+
+* 0.2.94
+- modify call list update method when recive
+== Sooyoung Ha <yoosah.ha@samsung.com> 2013-06-14
+
+* 0.2.93
+- Refactoring sdblib
+== kh5325.kim <kh5325.kim@samsung.com> 2013-06-04
+
+* 0.2.92
+- add yes/no popup when detach sdcard
+== Sooyoung Ha <yoosah.ha@samsung.com> 2013-06-03
+
+* 0.2.91
+- modify MAX value of rssi 5 -> 4
+- remove SMS timeout popup
+== Sooyoung Ha <yoosah.ha@samsung.com> 2013-05-30
+
+* 0.2.90
+- Refactoring sdblib
+== kh5325.kim <kh5325.kim@samsung.com> 2013-05-24
+
+* 0.2.89
+-  fix earjack issue
+== Sooyoung Ha <yoosah.ha@samsung.com> 2013-04-30
+
+* 0.2.88
+-  modify the MAX input digit to 82
+== Sooyoung Ha <yoosah.ha@samsung.com> 2013-04-24
+
+* 0.2.87
+- disconnect when the target-device is selected on connection explorer
+== Sooyoung Ha <yoosah.ha@samsung.com> 2013-04-16
+
+* 0.2.86
+- hide the sensor enable/disable check button
+== Sooyoung Ha <yoosah.ha@samsung.com> 2013-04-02
+
+* 0.2.85
+- modify sdcards' name for ext4.
+== Sooyoung Ha <yoosah.ha@samsung.com> 2013-03-20
+
+* 0.2.84
+- rename the button 'Move To Call' to 'Move To Ear'
+== Sooyoung Ha <yoosah.ha@samsung.com> 2013-03-19
+
+* 0.2.83
+- add a button on motion for moveToCall.
+== Sooyoung Ha <yoosah.ha@samsung.com> 2013-03-15
+
+* 0.2.82
+- add MMS Sent Status section.
+== Sooyoung Ha <yoosah.ha@samsung.com> 2013-03-12
+
+* 0.2.81
+- modify Telephony SMS ui and add port input.
+- Version up for Tizen 2.1, 0315
+== Sooyoung Ha <yoosah.ha@samsung.com> 2013-03-10
+
+* 0.2.80
+- modify the provider name to "The Linux Foundation".
+== Sooyoung Ha <yoosah.ha@samsung.com> 2013-02-14
+
+* 0.2.79
+- modify naming of sdcard buttons.
+== Sooyoung Ha <yoosah.ha@samsung.com> 2013-01-25
+
+* 0.2.76
+- modify mistype INCOMMING to INCOMING
+== Sooyoung Ha <yoosah.ha@samsung.com> 2012-12-20
+
+* 0.2.75
+- change get buffer nfc event
+== jihye kim <jihye1128.kim@samsung.com> 2012-12-13
+
+* 0.2.74
+- Added "org.tizen.sdblib" in Import-Package
+== Sooyoung Ha <yoosah.ha@samsung.com> 2012-11-29
+
+* 0.2.73
+- modify sending message rountine at the nfc event
+- need emuld version - 0.2.22
+== jihye kim <jihye1128.kim@samsung.com> 2012-11-21
+* 0.2.72
+- modify fixed accuracy value.
+== Sooyoung Ha <yoosah.ha@samsung.com> 2012-11-21
+
+* 0.2.71
+- change gyroscope value. (sensord 0.2.24)
+== jihye kim <jihye1128.kim@samsung.com> 2012-11-19
+
+* 0.2.70
+- add dialing boolean flag.
+== Sooyoung Ha <yoosah.ha@samsung.com> 2012-11-14
+
+* 0.2.69
+- modify proximity sensor event value.
+== Sooyoung Ha <yoosah.ha@samsung.com> 2012-11-14
+
+* 0.2.68
+- add changelog file
+== Sooyoung Ha <yoosah.ha@samsung.com> 2012-11-05
index 4841744..78b9e85 100644 (file)
@@ -1,19 +1,38 @@
-Package:eventinjector-eplugin
-Version:0.2.19
-OS:linux
-Build-host-os:linux
+Source:eventinjector-eplugin
+Version:0.2.95
 Maintainer:yeongkyoon Lee <yeongkyoon.lee@samsung.com>, sungmin Ha <sungmin82.ha@samsung.com>
+
+Package:eventinjector-eplugin
+OS:ubuntu-32
+Build-host-os:ubuntu-32
 Description:EventInjector for emulator
-Build-dependency:indigo-pde[linux], common-eplugin[linux]
-Install-dependency:common-eplugin[linux], base-ide-product[linux]
-Source:eventinjector-eplugin
+Build-dependency:indigo-pde[ubuntu-32], common-eplugin[ubuntu-32]
+Install-dependency:common-eplugin[ubuntu-32], base-ide-product[ubuntu-32]
 
 Package:eventinjector-eplugin
-Version:0.2.19
-OS:windows
-Build-host-os:linux
-Maintainer:yeongkyoon Lee <yeongkyoon.lee@samsung.com>, sungmin Ha <sungmin82.ha@samsung.com>
+OS:ubuntu-64
+Build-host-os:ubuntu-64
 Description:EventInjector for emulator
-Build-dependency:indigo-winpde[windows], common-eplugin[linux]
-Install-dependency:common-eplugin[windows], base-ide-product[windows]
-Source:eventinjector-eplugin
+Build-dependency:indigo-pde[ubuntu-64], common-eplugin[ubuntu-64]
+Install-dependency:common-eplugin[ubuntu-64], base-ide-product[ubuntu-64]
+
+Package:eventinjector-eplugin
+OS:windows-32
+Build-host-os:ubuntu-32
+Description:EventInjector for emulator
+Build-dependency:indigo-winpde[windows-32], common-eplugin[windows-32]
+Install-dependency:common-eplugin[windows-32], base-ide-product[windows-32]
+
+Package:eventinjector-eplugin
+OS:windows-64
+Build-host-os:ubuntu-64
+Description:EventInjector for emulator
+Build-dependency:indigo-winpde[windows-64], common-eplugin[windows-64]
+Install-dependency:common-eplugin[windows-64], base-ide-product[windows-64]
+
+Package:eventinjector-eplugin
+OS:macos-64
+Build-host-os:ubuntu-32
+Description:EventInjector for emulator
+Build-dependency:indigo-macpde[macos-64], common-eplugin[macos-64]
+Install-dependency:common-eplugin[macos-64], base-ide-product[macos-64]