USB 장치 중에 vid가 0bda이고 pid가 8176인 장치가 연결되어 있는지 알아 보는 방법입니다.
USB node는 /sys/bus/usb/devices/ 에 생성되고 idVendor와 idProuct를 읽어보면 됩니다.
{
DIR *dir = opendir("/sys/bus/usb/devices/");
struct dirent *dent;
if (dir != NULL) {
while ((dent = readdir(dir)) != NULL) {
char node[50] = {'\0',};
sprintf(node, "/sys/bus/usb/devices/%s/idVendor", dent->d_name);
int vid_fd = open(node, O_RDONLY);
char buf[5];
if (vid_fd > 0) {
read(vid_fd, buf, 4);
ALOGE("node = %s, vid = %s", node, buf);
if (strcmp(buf, "0bda") == 0) {
sprintf(node, "/sys/bus/usb/devices/%s/idProduct", dent->d_name);
int pid_fd = open(node, O_RDONLY);
read(pid_fd, buf, 4);
ALOGE("node = %s, pid = %s", node, buf);
if (pid_fd > 0) {
if (strcmp(buf, "8176") == 0) {
//pid가 8176인 장치가 연결되어 있음
break;
}
close(pid_fd);
}
}
close(vid_fd);
}
}
}
close(dir);
}
2013년 12월 22일 일요일
2013년 12월 11일 수요일
AOSP build and run emulator(Android Virtual Device)
1. Download android source code.
http://source.android.com/source/downloading.html
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.4_r1.2
$ repo sync
2. Build
$ source build/envsetup.sh
$ lunch
You're building on Linux
Lunch menu... pick a combo:
1. aosp_arm-eng
2. aosp_x86-eng
3. aosp_mips-eng
4. vbox_x86-eng
5. mini_mips-userdebug
6. mini_armv7a_neon-userdebug
7. mini_x86-userdebug
8. aosp_manta-userdebug
9. aosp_grouper-userdebug
10. aosp_flo-userdebug
11. aosp_deb-userdebug
12. aosp_tilapia-userdebug
13. aosp_mako-userdebug
14. aosp_hammerhead-userdebug
Which would you like? [aosp_arm-eng] 1
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.4
TARGET_PRODUCT=aosp_arm
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
TARGET_CPU_VARIANT=generic
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.11.0-14-generic-x86_64-with-Ubuntu-13.10-saucy
HOST_BUILD_TYPE=release
BUILD_ID=KRT16S
OUT_DIR=out
============================================
[~/projects/android_kitkat]$ make -j8
....
k-r8e/:/opt/toolchains/arm-eabi-4.6/bin/:/opt/toolchains/arm-2010q1/bin:/usr/bin/:/usr/lib/ccache
+ ENABLE_SPARSE_IMAGE=
+ '[' out/target/product/generic/system = -s ']'
+ '[' 6 -ne 5 -a 6 -ne 6 ']'
+ SRC_DIR=out/target/product/generic/system
+ '[' '!' -d out/target/product/generic/system ']'
+ OUTPUT_FILE=out/target/product/generic/obj/PACKAGING/systemimage_intermediates/system.img
+ EXT_VARIANT=ext4
+ MOUNT_POINT=system
+ SIZE=576716800
+ FC=out/target/product/generic/root/file_contexts
+ case $EXT_VARIANT in
+ '[' -z system ']'
+ '[' -z 576716800 ']'
+ '[' -n out/target/product/generic/root/file_contexts ']'
+ FCOPT='-S out/target/product/generic/root/file_contexts'
+ MAKE_EXT4FS_CMD='make_ext4fs -S out/target/product/generic/root/file_contexts -l 576716800 -a system out/target/product/generic/obj/PACKAGING/systemimage_intermediates/system.img out/target/product/generic/system'
+ echo make_ext4fs -S out/target/product/generic/root/file_contexts -l 576716800 -a system out/target/product/generic/obj/PACKAGING/systemimage_intermediates/system.img out/target/product/generic/system
make_ext4fs -S out/target/product/generic/root/file_contexts -l 576716800 -a system out/target/product/generic/obj/PACKAGING/systemimage_intermediates/system.img out/target/product/generic/system
+ make_ext4fs -S out/target/product/generic/root/file_contexts -l 576716800 -a system out/target/product/generic/obj/PACKAGING/systemimage_intermediates/system.img out/target/product/generic/system
Creating filesystem with parameters:
Size: 576716800
Block size: 4096
Blocks per group: 32768
Inodes per group: 7040
Inode size: 256
Journal blocks: 2200
Label:
Blocks: 140800
Block groups: 5
Reserved block group size: 39
Created filesystem with 1262/35200 inodes and 81852/140800 blocks
+ '[' 0 -ne 0 ']'
Install system fs image: out/target/product/generic/system.img
out/target/product/generic/system.img+ maxsize=588791808 blocksize=2112 total=576716800 reserve=5947392
[~/projects/android_kitkat]$
3. Install eclipse and adt
http://developer.android.com/sdk/installing/installing-adt.html
4. Install android sdk
https://developer.android.com/sdk/index.html
5. Android SDK Manager
update API 19
8. Run AVD
http://source.android.com/source/downloading.html
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.4_r1.2
$ repo sync
2. Build
$ source build/envsetup.sh
$ lunch
You're building on Linux
Lunch menu... pick a combo:
1. aosp_arm-eng
2. aosp_x86-eng
3. aosp_mips-eng
4. vbox_x86-eng
5. mini_mips-userdebug
6. mini_armv7a_neon-userdebug
7. mini_x86-userdebug
8. aosp_manta-userdebug
9. aosp_grouper-userdebug
10. aosp_flo-userdebug
11. aosp_deb-userdebug
12. aosp_tilapia-userdebug
13. aosp_mako-userdebug
14. aosp_hammerhead-userdebug
Which would you like? [aosp_arm-eng] 1
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.4
TARGET_PRODUCT=aosp_arm
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
TARGET_CPU_VARIANT=generic
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.11.0-14-generic-x86_64-with-Ubuntu-13.10-saucy
HOST_BUILD_TYPE=release
BUILD_ID=KRT16S
OUT_DIR=out
============================================
[~/projects/android_kitkat]$ make -j8
....
k-r8e/:/opt/toolchains/arm-eabi-4.6/bin/:/opt/toolchains/arm-2010q1/bin:/usr/bin/:/usr/lib/ccache
+ ENABLE_SPARSE_IMAGE=
+ '[' out/target/product/generic/system = -s ']'
+ '[' 6 -ne 5 -a 6 -ne 6 ']'
+ SRC_DIR=out/target/product/generic/system
+ '[' '!' -d out/target/product/generic/system ']'
+ OUTPUT_FILE=out/target/product/generic/obj/PACKAGING/systemimage_intermediates/system.img
+ EXT_VARIANT=ext4
+ MOUNT_POINT=system
+ SIZE=576716800
+ FC=out/target/product/generic/root/file_contexts
+ case $EXT_VARIANT in
+ '[' -z system ']'
+ '[' -z 576716800 ']'
+ '[' -n out/target/product/generic/root/file_contexts ']'
+ FCOPT='-S out/target/product/generic/root/file_contexts'
+ MAKE_EXT4FS_CMD='make_ext4fs -S out/target/product/generic/root/file_contexts -l 576716800 -a system out/target/product/generic/obj/PACKAGING/systemimage_intermediates/system.img out/target/product/generic/system'
+ echo make_ext4fs -S out/target/product/generic/root/file_contexts -l 576716800 -a system out/target/product/generic/obj/PACKAGING/systemimage_intermediates/system.img out/target/product/generic/system
make_ext4fs -S out/target/product/generic/root/file_contexts -l 576716800 -a system out/target/product/generic/obj/PACKAGING/systemimage_intermediates/system.img out/target/product/generic/system
+ make_ext4fs -S out/target/product/generic/root/file_contexts -l 576716800 -a system out/target/product/generic/obj/PACKAGING/systemimage_intermediates/system.img out/target/product/generic/system
Creating filesystem with parameters:
Size: 576716800
Block size: 4096
Blocks per group: 32768
Inodes per group: 7040
Inode size: 256
Journal blocks: 2200
Label:
Blocks: 140800
Block groups: 5
Reserved block group size: 39
Created filesystem with 1262/35200 inodes and 81852/140800 blocks
+ '[' 0 -ne 0 ']'
Install system fs image: out/target/product/generic/system.img
out/target/product/generic/system.img+ maxsize=588791808 blocksize=2112 total=576716800 reserve=5947392
[~/projects/android_kitkat]$
3. Install eclipse and adt
http://developer.android.com/sdk/installing/installing-adt.html
4. Install android sdk
https://developer.android.com/sdk/index.html
5. Android SDK Manager
update API 19
6. Change your output images.
$ [~/android-sdks/system-images/android-19]$ cd armeabi-v7a/
[~/android-sdks/system-images/android-19/armeabi-v7a]$ ls
build.prop NOTICE.txt source.properties userdata.img
kernel-qemu ramdisk.img system.img
7. Make avd
8. Run AVD
2013년 12월 9일 월요일
Exynos4412 Android-4.1.2 (Beta 2.1.0) Release
29-Jun-2014
1. fix EDID
2. enable MTP
3. fix uboot to enable cm bootstrap.
Download for eMMC user.
https://www.dropbox.com/sh/vjplveim5ieq91e/jUSKWcmjw4
How to connect ODROID to Ubuntu using MTP
http://codewalkerster.blogspot.kr/2014/01/how-to-connect-odroid-to-ubuntu-using.html
19-Dec-2013
1. enable /dev/CEC node.
2. enable HDMI-EDID/CEC
https://www.dropbox.com/s/7nhmnnssuekk50n/odroidu-1.9.0.zip
http://dn.odroid.com/Android_Beta_1.9.0/
수정사항
1. Q/Q2 부팅 시 죽는 문제 수정
2. SD/eMMC 를 하나의 커널로 통합.
3. ODROID-U2를 ODROID-U로 변경
업그레이드 방법
1. X/X2/Q/Q2는 기존 방법처럼 아래와 같이 진행
http://codewalkerster.blogspot.kr/2013/05/odroid-update-and-install-gms.html
2. U2는 microSD일 경우 아래 이미지를 write하고 부팅
http://dn.odroid.com/Android_Beta_1.9.0/U/SD/
eMMC일 경우 아래 이미지를 write 하고 부팅 하면 자동 복구 후 부팅
http://dn.odroid.com/Android_Beta_1.9.0/U/eMMC_installer/
Google Mobile Service(GMS) 설치는 아래와 같이 One Click gapps installer에서 4.1.2를 선택.
http://codewalkerster.blogspot.kr/2013/11/universal-1-click-gapps-installer-for.html
1. fix EDID
2. enable MTP
3. fix uboot to enable cm bootstrap.
Download for eMMC user.
https://www.dropbox.com/sh/vjplveim5ieq91e/jUSKWcmjw4
How to connect ODROID to Ubuntu using MTP
http://codewalkerster.blogspot.kr/2014/01/how-to-connect-odroid-to-ubuntu-using.html
19-Dec-2013
1. enable /dev/CEC node.
2. enable HDMI-EDID/CEC
https://www.dropbox.com/s/7nhmnnssuekk50n/odroidu-1.9.0.zip
http://dn.odroid.com/Android_Beta_1.9.0/
수정사항
1. Q/Q2 부팅 시 죽는 문제 수정
2. SD/eMMC 를 하나의 커널로 통합.
3. ODROID-U2를 ODROID-U로 변경
업그레이드 방법
1. X/X2/Q/Q2는 기존 방법처럼 아래와 같이 진행
http://codewalkerster.blogspot.kr/2013/05/odroid-update-and-install-gms.html
2. U2는 microSD일 경우 아래 이미지를 write하고 부팅
http://dn.odroid.com/Android_Beta_1.9.0/U/SD/
eMMC일 경우 아래 이미지를 write 하고 부팅 하면 자동 복구 후 부팅
http://dn.odroid.com/Android_Beta_1.9.0/U/eMMC_installer/
Google Mobile Service(GMS) 설치는 아래와 같이 One Click gapps installer에서 4.1.2를 선택.
http://codewalkerster.blogspot.kr/2013/11/universal-1-click-gapps-installer-for.html
2013년 11월 24일 일요일
ODROID adb/fastboot driver 설치 하기(Windows 7 64bit)
드라이버를 다운 받습니다.
'장치 관리자'를 실행합니다.
'Full Android on SMDK4412'를 선택합니다.
'드라이버 업데이트'를 클릭합니다.
'컴퓨터에서 드라이버 소프트웨어 찾아보기'를 선택합니다.
'컴퓨터의 장치 드라이버 목록에서 직접 선택'을 선택합니다.
'ADB Interface'를 선택합니다.
'ADB Testing Interface'를 선택합니다.
'디스크 있음' 선택합니다.
다운 받은 파일을 압축 풀고 그 폴더를 선택합니다.
windows 7 64bit의 경우 amd64 폴더의 android_usb.inf 선택하고 windows xp(32bit)인 경우 x86의 android_usb.inf를 선택합니다.
fastboot로 연결 시 드라이버(Android 1.0)를 다시 설치 하셔야 합니다.
아래 링크에서 fastboot와 driver를 받으실 수 있습니다.
2013년 11월 18일 월요일
Universal 1-Click GApps Installer for ODROID
If you are using ODROID-C1/C2, try this method. Does not need gapps installer app anymore.
for ODROID-C2
http://codewalkerster.blogspot.kr/2013/11/universal-1-click-gapps-installer-for.html
for Lollipop Android-5.x (CM-12.1 Unofficial Version)
http://dn.odroid.com/GAPPS/GAppsInstaller_lollipop.apk
http://codewalkerster.blogspot.kr/2015/06/how-to-install-gappsinstallerlollipop.html
for KitKat Android 4.4.x
http://dn.odroid.com/GAPPS/GAppsInstaller_kitkat.apk
for JellyBean Android 4.2.x or Android 4.1.x
http://dn.odroid.com/GAPPS/GAppsInstaller_jellybean.apk
----------------------------------------------------------------------------------------------------
Updated GAppsInstaller app.(Apr/23/2015)
http://forum.odroid.com/viewtopic.php?f=113&t=11854&start=50
----------------------------------------------------------------------------------------------------
http://forum.odroid.com/viewtopic.php?f=60&t=2769
Universal 1-Click GApps Installer
install last official android firmware
Run web browser.
Visit web site.
http://forum.odroid.com/viewtopic.php?f=60&t=2769&sid=ebf9b5b027ba544d5a5b262bdeef04db
Down load Universal 1-Click GApps Installer.
for JellyBean(android-4.1.2 and 4.2.2)
http://dn.odroid.com/GAPPS/GAppsInstaller_jellybean.apk
Run Ultra explorer.
Go to Downloads folder.
Click app long and "Open As"
Select File.
Select Package Installer.
Get su permission.
Select Gapps for Android version.
http://codewalkerster.blogspot.kr/2013/11/universal-1-click-gapps-installer-for.html
for Lollipop Android-5.x (CM-12.1 Unofficial Version)
http://dn.odroid.com/GAPPS/GAppsInstaller_lollipop.apk
http://codewalkerster.blogspot.kr/2015/06/how-to-install-gappsinstallerlollipop.html
for KitKat Android 4.4.x
http://dn.odroid.com/GAPPS/GAppsInstaller_kitkat.apk
for JellyBean Android 4.2.x or Android 4.1.x
http://dn.odroid.com/GAPPS/GAppsInstaller_jellybean.apk
----------------------------------------------------------------------------------------------------
Updated GAppsInstaller app.(Apr/23/2015)
http://forum.odroid.com/viewtopic.php?f=113&t=11854&start=50
----------------------------------------------------------------------------------------------------
http://forum.odroid.com/viewtopic.php?f=60&t=2769
Universal 1-Click GApps Installer
install last official android firmware
Run web browser.
Visit web site.
http://forum.odroid.com/viewtopic.php?f=60&t=2769&sid=ebf9b5b027ba544d5a5b262bdeef04db
for JellyBean(android-4.1.2 and 4.2.2)
http://dn.odroid.com/GAPPS/GAppsInstaller_jellybean.apk
Run Ultra explorer.
Go to Downloads folder.
Click app long and "Open As"
Select File.
Select Package Installer.
Run GApps Installer.
Get su permission.
Select Gapps for Android version.
App is finished to install, automatically restarted system.
2013년 10월 25일 금요일
android init에서 service를 trigger 시키기
service insmod_ax88179 /system/bin/insmod /system/lib/modules/ax88179_178a.ko
class core
user root
group root
oneshot
service insmod_smsc95xx /system/bin/insmod /system/lib/modules/smsc95xx.ko
class core
user root
group root
oneshot
위와 같이 smsc95xx, ax88179_178a driver를 올리는 서버스를 만들어 먼저 ax88179_178a를 먼저 insmod하여 eth0를 ax88179_178a에 할당하고 싶었다.
하지만 라인 순서와 상관없이 서비스가 실행 된다.
그래서 하나의 service가 끝나고 다른 service를 trigger 시킬 방법을 찾아 보았다.
조건에 의해 실행된 서버스를 oneshot에서 disabled로 자동 실행이 되지 않도록 수정한다.
service insmod_smsc95xx /system/bin/insmod /system/lib/modules/smsc95xx.ko
class core
user root
group root
oneshot
service insmod_smsc95xx /system/bin/insmod /system/lib/modules/smsc95xx.ko
class core
user root
group root
oneshot
위와 같이 smsc95xx, ax88179_178a driver를 올리는 서버스를 만들어 먼저 ax88179_178a를 먼저 insmod하여 eth0를 ax88179_178a에 할당하고 싶었다.
하지만 라인 순서와 상관없이 서비스가 실행 된다.
그래서 하나의 service가 끝나고 다른 service를 trigger 시킬 방법을 찾아 보았다.
조건에 의해 실행된 서버스를 oneshot에서 disabled로 자동 실행이 되지 않도록 수정한다.
service insmod_smsc95xx /system/bin/insmod /system/lib/modules/smsc95xx.ko
class core
user root
group root
disabled
oneshot
oneshot
그리고 첫번째 service가 실행되었는지 확인 할 수 있는 변수와 두번째 service를 실행 시킬 방법은 아래와 같다.
on property:init.svc.insmod_ax88179=stopped
start insmod_smsc95xx
이렇게 고치면 ax88179_178a.ko가 먼저 insmod가 되고 eth0로 할당 받을 수 있다.
2013년 10월 19일 토요일
Smart Power s/w version 1.1.0 update
Smart Power
software version 1.1.0
Modify Log start UI.
software version 1.0.9
wiki
http://odroid.com/dokuwiki/doku.php?id=en:odroidsmartpower
source and binary
http://dn.odroid.com/Smart_Power/
software version 1.1.0
Modify Log start UI.
software version 1.0.9
wiki
http://odroid.com/dokuwiki/doku.php?id=en:odroidsmartpower
source and binary
http://dn.odroid.com/Smart_Power/
피드 구독하기:
글 (Atom)