Skip to content

Rage2/android_external_hotplugd

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OBSOLETE: THIS REPO WILL BE DELETED SOON.

Repo's marked as obsolete have normally been superceeded by newer work

Description:
hotplugd - Android Service that listen to kernel events using the UEVENT Socket

Purpose:
Mainly developed to handle usb_modeswitch and connection management for Huawei USB Dongles ( Usb Vendor ID:12d1 )
can be easily repurposed to handle any kernel level event.

This is service is dependent on libusb-1.x . A slighty tweaked version for Android can be found 
here https://github.com/trevd/libusb-android

For hotplugd to function the following prerequisites must be met

1. a usb_modeswitch data directory must exists at one of the following locations
/system/etc/usb_modeswitch 
/system/etc/usb_modeswitch.d
/etc/usb_modeswitch 

2. the files in the usb_modeswitch directory must be named in the following format
vendorid_productid e.g 12d1_1446

3. a system service named switch_ms_to_3g must be defined - this executes the usb_modeswitch binary
   and passes the vendorid, productid (as discovered by the uevent poll) and the full path to the
   configuration file
   
4. a system service named ril-daemon must defined - this is start when a tty device name ttyUSB2 is 
   created, this may be better fired off when a wwan device is created instead
   
The service can be run in two modes 
1. hotplugd - intended to do continous monitoring through out the life of the system
2. preheated - which is intended to be triggered when the dev has finished booting. Preheated Mode looks for
devices already plugging in

Example Service Definitions for init.rc

        on boot
         
        on property:dev.bootcomplete=1
                start preheated

        service hotplugd /system/bin/logwrapper /system/bin/hotplugd
            class core

        # preheated is a symlink to hotplug. This check if the device is already connected
        service preheated /system/bin/logwrapper /system/bin/hotplugd preheated
            oneshot     
            disbaled
            
        service switch_ms_to_3g /system/bin/logwrapper /system/bin/usb_modeswitch
            class core
            user root
            group root
            disabled
            oneshot


        # disabled rild to be started at a later by the hotplugd
        service ril-daemon /system/bin/rild
            socket rild stream 660 root radio
            socket rild-debug stream 660 radio system
            user root
            group radio cache inet misc audio sdcard_rw
            disabled










About

Android service to listen to kernel events

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 99.4%
  • Makefile 0.6%