Compare commits
	
		
			19 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					bb61f00d57 | ||
| 
						 | 
					601ef084ee | ||
| 
						 | 
					3cd41646b4 | ||
| 
						 | 
					d1fb490f9b | ||
| 
						 | 
					7e0c222f1d | ||
| 
						 | 
					f5b2cc062c | ||
| 
						 | 
					9e246ebb55 | ||
| 
						 | 
					5f5afc3d76 | ||
| 
						 | 
					eab404c46b | ||
| 
						 | 
					395a50ba3d | ||
| 
						 | 
					79379ea3d1 | ||
| 
						 | 
					197e84e71a | ||
| 
						 | 
					30ea57a3cb | ||
| 
						 | 
					49fcc2a599 | ||
| 
						 | 
					6d9f87f7ea | ||
| 
						 | 
					efc30cd06d | ||
| 
						 | 
					6959979384 | ||
| 
						 | 
					1ebf32bc73 | ||
| 
						 | 
					a119a68374 | 
							
								
								
									
										3
									
								
								AUTHORS
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								AUTHORS
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
Danct12 <danct12@disroot.org>
 | 
			
		||||
Frajo Haider <f_haider@gmx.at>
 | 
			
		||||
Slava Monich <slava@monich.com>
 | 
			
		||||
							
								
								
									
										12
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								Makefile
									
									
									
									
									
								
							@@ -23,7 +23,7 @@ all: debug release pkgconfig
 | 
			
		||||
 | 
			
		||||
VERSION_MAJOR = 1
 | 
			
		||||
VERSION_MINOR = 0
 | 
			
		||||
VERSION_RELEASE = 2
 | 
			
		||||
VERSION_RELEASE = 9
 | 
			
		||||
 | 
			
		||||
# Version for pkg-config
 | 
			
		||||
PCVERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_RELEASE)
 | 
			
		||||
@@ -144,9 +144,6 @@ pkgconfig: $(PKGCONFIG)
 | 
			
		||||
clean:
 | 
			
		||||
	rm -f *~ $(SRC_DIR)/*~ $(INCLUDE_DIR)/*~
 | 
			
		||||
	rm -fr $(BUILD_DIR) RPMS installroot
 | 
			
		||||
	rm -fr debian/tmp debian/libgbinder debian/libgbinder-dev
 | 
			
		||||
	rm -f documentation.list debian/files debian/*.substvars
 | 
			
		||||
	rm -f debian/*.debhelper.log debian/*.debhelper debian/*~
 | 
			
		||||
 | 
			
		||||
$(BUILD_DIR):
 | 
			
		||||
	mkdir -p $@
 | 
			
		||||
@@ -199,18 +196,17 @@ $(PKGCONFIG): $(LIB_NAME).pc.in Makefile
 | 
			
		||||
# Install
 | 
			
		||||
#
 | 
			
		||||
 | 
			
		||||
INSTALL_PERM  = 644
 | 
			
		||||
 | 
			
		||||
INSTALL = install
 | 
			
		||||
INSTALL_DIRS = $(INSTALL) -d
 | 
			
		||||
INSTALL_FILES = $(INSTALL) -m $(INSTALL_PERM)
 | 
			
		||||
INSTALL_LIBS = $(INSTALL) -m 755
 | 
			
		||||
INSTALL_FILES = $(INSTALL) -m 644
 | 
			
		||||
 | 
			
		||||
INSTALL_LIB_DIR = $(DESTDIR)/usr/lib
 | 
			
		||||
INSTALL_INCLUDE_DIR = $(DESTDIR)/usr/include/$(NAME)
 | 
			
		||||
INSTALL_PKGCONFIG_DIR = $(DESTDIR)/usr/lib/pkgconfig
 | 
			
		||||
 | 
			
		||||
install: $(INSTALL_LIB_DIR)
 | 
			
		||||
	$(INSTALL_FILES) $(RELEASE_SO) $(INSTALL_LIB_DIR)
 | 
			
		||||
	$(INSTALL_LIBS) $(RELEASE_SO) $(INSTALL_LIB_DIR)
 | 
			
		||||
	ln -sf $(LIB_SO) $(INSTALL_LIB_DIR)/$(LIB_SYMLINK2)
 | 
			
		||||
	ln -sf $(LIB_SYMLINK2) $(INSTALL_LIB_DIR)/$(LIB_SYMLINK1)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										5
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
libgbinder-radio (1.0.9) unstable; urgency=medium
 | 
			
		||||
 | 
			
		||||
  * Added packaging for Debian-based distros.
 | 
			
		||||
 | 
			
		||||
 -- Danct12 <danct12@disroot.org>  Tue, 24 Mar 2020 02:55:50 +0700
 | 
			
		||||
							
								
								
									
										1
									
								
								debian/compat
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								debian/compat
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
9
 | 
			
		||||
							
								
								
									
										17
									
								
								debian/control
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								debian/control
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
			
		||||
Source: libgbinder-radio
 | 
			
		||||
Priority: optional
 | 
			
		||||
Maintainer: Danct12 <danct12@disroot.org>
 | 
			
		||||
Build-Depends: debhelper (>=9), libgbinder-dev (>= 1.0.9)
 | 
			
		||||
Standards-Version: 3.9.6
 | 
			
		||||
 | 
			
		||||
Package: libgbinder-radio-dev
 | 
			
		||||
Section: libdevel
 | 
			
		||||
Architecture: any
 | 
			
		||||
Depends: libgbinder-radio (= ${binary:Version}), ${misc:Depends}
 | 
			
		||||
Description: Development files for libgbinder-radio
 | 
			
		||||
 | 
			
		||||
Package: libgbinder-radio
 | 
			
		||||
Section: libs
 | 
			
		||||
Architecture: any
 | 
			
		||||
Depends: libgbinder (>= 1.0.9), ${shlibs:Depends}, ${misc:Depends}
 | 
			
		||||
Description: Binder client library for Android radio interfaces
 | 
			
		||||
							
								
								
									
										33
									
								
								debian/copyright
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								debian/copyright
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,33 @@
 | 
			
		||||
Copyright (C) 2018-2019 Jolla Ltd.
 | 
			
		||||
Copyright (C) 2018-2019 Slava Monich <slava.monich@jolla.com>
 | 
			
		||||
 | 
			
		||||
You may use this file under the terms of the BSD license as follows:
 | 
			
		||||
 | 
			
		||||
Redistribution and use in source and binary forms, with or without
 | 
			
		||||
modification, are permitted provided that the following conditions
 | 
			
		||||
are met:
 | 
			
		||||
 | 
			
		||||
  1. Redistributions of source code must retain the above copyright
 | 
			
		||||
     notice, this list of conditions and the following disclaimer.
 | 
			
		||||
  2. Redistributions in binary form must reproduce the above copyright
 | 
			
		||||
     notice, this list of conditions and the following disclaimer in the
 | 
			
		||||
     documentation and/or other materials provided with the distribution.
 | 
			
		||||
  3. Neither the names of the copyright holders nor the names of its
 | 
			
		||||
     contributors may be used to endorse or promote products derived
 | 
			
		||||
     from this software without specific prior written permission.
 | 
			
		||||
 | 
			
		||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 | 
			
		||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 | 
			
		||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 | 
			
		||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
 | 
			
		||||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 | 
			
		||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 | 
			
		||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 | 
			
		||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 | 
			
		||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 | 
			
		||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 | 
			
		||||
THE POSSIBILITY OF SUCH DAMAGE.
 | 
			
		||||
 | 
			
		||||
The views and conclusions contained in the software and documentation
 | 
			
		||||
are those of the authors and should not be interpreted as representing
 | 
			
		||||
any official policies, either expressed or implied.
 | 
			
		||||
							
								
								
									
										3
									
								
								debian/libgbinder-radio-dev.install
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								debian/libgbinder-radio-dev.install
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
debian/tmp/usr/lib/libgbinder-radio.so usr/lib
 | 
			
		||||
include/*.h usr/include/gbinder-radio
 | 
			
		||||
build/libgbinder-radio.pc usr/lib/pkgconfig
 | 
			
		||||
							
								
								
									
										1
									
								
								debian/libgbinder-radio.install
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								debian/libgbinder-radio.install
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
debian/tmp/usr/lib/libgbinder-radio.so.* usr/lib
 | 
			
		||||
							
								
								
									
										9
									
								
								debian/rules
									
									
									
									
										vendored
									
									
										Executable file
									
								
							
							
						
						
									
										9
									
								
								debian/rules
									
									
									
									
										vendored
									
									
										Executable file
									
								
							@@ -0,0 +1,9 @@
 | 
			
		||||
#!/usr/bin/make -f
 | 
			
		||||
# Uncomment to enable verbose build
 | 
			
		||||
#export DH_VERBOSE = 1
 | 
			
		||||
 | 
			
		||||
override_dh_auto_install:
 | 
			
		||||
	dh_auto_install -- install-dev
 | 
			
		||||
 | 
			
		||||
%:
 | 
			
		||||
	dh $@ 
 | 
			
		||||
							
								
								
									
										1
									
								
								debian/source/format
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								debian/source/format
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
3.0 (native)
 | 
			
		||||
@@ -52,6 +52,10 @@ struct radio_instance {
 | 
			
		||||
    const char* dev;
 | 
			
		||||
    const char* slot;
 | 
			
		||||
    const char* key;
 | 
			
		||||
    /* Since 1.0.7 */
 | 
			
		||||
    const char* modem;  /* D-Bus path */
 | 
			
		||||
    int slot_index;     /* 0 for SIM1, 1 for SIM2 and so on */
 | 
			
		||||
    gboolean enabled;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
typedef
 | 
			
		||||
@@ -113,6 +117,13 @@ radio_instance_new(
 | 
			
		||||
    const char* dev,
 | 
			
		||||
    const char* name);
 | 
			
		||||
 | 
			
		||||
RadioInstance*
 | 
			
		||||
radio_instance_new_with_modem_and_slot(
 | 
			
		||||
    const char* dev,
 | 
			
		||||
    const char* name,
 | 
			
		||||
    const char* modem,
 | 
			
		||||
    int slot_index); /* Since 1.0.7 */
 | 
			
		||||
 | 
			
		||||
RadioInstance*
 | 
			
		||||
radio_instance_get(
 | 
			
		||||
    const char* dev,
 | 
			
		||||
@@ -160,6 +171,11 @@ radio_instance_send_request_sync(
 | 
			
		||||
    RADIO_REQ code,
 | 
			
		||||
    GBinderLocalRequest* args);
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
radio_instance_set_enabled(
 | 
			
		||||
    RadioInstance* radio,
 | 
			
		||||
    gboolean enabled); /* Since 1.0.7 */
 | 
			
		||||
 | 
			
		||||
gulong
 | 
			
		||||
radio_instance_add_indication_handler(
 | 
			
		||||
    RadioInstance* radio,
 | 
			
		||||
@@ -200,6 +216,12 @@ radio_instance_add_death_handler(
 | 
			
		||||
    RadioInstanceFunc func,
 | 
			
		||||
    gpointer user_data);
 | 
			
		||||
 | 
			
		||||
gulong
 | 
			
		||||
radio_instance_add_enabled_handler(
 | 
			
		||||
    RadioInstance* radio,
 | 
			
		||||
    RadioInstanceFunc func,
 | 
			
		||||
    gpointer user_data); /* Since 1.0.7 */
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
radio_instance_remove_handler(
 | 
			
		||||
    RadioInstance* radio,
 | 
			
		||||
 
 | 
			
		||||
@@ -175,6 +175,44 @@ typedef enum radio_access_family {
 | 
			
		||||
} RADIO_ACCESS_FAMILY;
 | 
			
		||||
G_STATIC_ASSERT(sizeof(RADIO_ACCESS_FAMILY) == 4);
 | 
			
		||||
 | 
			
		||||
typedef enum radio_apn_auth_type {
 | 
			
		||||
    RADIO_APN_AUTH_NONE,
 | 
			
		||||
    RADIO_APN_AUTH_PAP,
 | 
			
		||||
    RADIO_APN_AUTH_CHAP,
 | 
			
		||||
    RADIO_APN_AUTH_PAP_CHAP
 | 
			
		||||
} RADIO_APN_AUTH_TYPE;
 | 
			
		||||
G_STATIC_ASSERT(sizeof(RADIO_APN_AUTH_TYPE) == 4);
 | 
			
		||||
 | 
			
		||||
typedef enum radio_apn_types {
 | 
			
		||||
    RADIO_APN_TYPE_NONE = 0,
 | 
			
		||||
    RADIO_APN_TYPE_DEFAULT = 1 << 0,
 | 
			
		||||
    RADIO_APN_TYPE_MMS = 1 << 1,
 | 
			
		||||
    RADIO_APN_TYPE_SUPL = 1 << 2,
 | 
			
		||||
    RADIO_APN_TYPE_DUN = 1 << 3,
 | 
			
		||||
    RADIO_APN_TYPE_HIPRI = 1 << 4,
 | 
			
		||||
    RADIO_APN_TYPE_FOTA = 1 << 5,
 | 
			
		||||
    RADIO_APN_TYPE_IMS = 1 << 6,
 | 
			
		||||
    RADIO_APN_TYPE_CBS = 1 << 7,
 | 
			
		||||
    RADIO_APN_TYPE_IA = 1 << 8,
 | 
			
		||||
    RADIO_APN_TYPE_EMERGENCY = 1 << 9,
 | 
			
		||||
    RADIO_APN_TYPE_ALL = RADIO_APN_TYPE_DEFAULT | RADIO_APN_TYPE_MMS |
 | 
			
		||||
        RADIO_APN_TYPE_SUPL | RADIO_APN_TYPE_DUN | RADIO_APN_TYPE_HIPRI |
 | 
			
		||||
        RADIO_APN_TYPE_FOTA | RADIO_APN_TYPE_IMS | RADIO_APN_TYPE_CBS |
 | 
			
		||||
        RADIO_APN_TYPE_IA | RADIO_APN_TYPE_EMERGENCY
 | 
			
		||||
} RADIO_APN_TYPES;
 | 
			
		||||
G_STATIC_ASSERT(sizeof(RADIO_APN_TYPES) == 4);
 | 
			
		||||
 | 
			
		||||
typedef enum radio_data_profile_id {
 | 
			
		||||
    RADIO_DATA_PROFILE_INVALID = -1,
 | 
			
		||||
    RADIO_DATA_PROFILE_DEFAULT = 0,
 | 
			
		||||
    RADIO_DATA_PROFILE_TETHERED = 1,
 | 
			
		||||
    RADIO_DATA_PROFILE_IMS = 2,
 | 
			
		||||
    RADIO_DATA_PROFILE_FOTA = 3,
 | 
			
		||||
    RADIO_DATA_PROFILE_CBS = 4,
 | 
			
		||||
    RADIO_DATA_PROFILE_OEM_BASE = 1000
 | 
			
		||||
} RADIO_DATA_PROFILE_ID;
 | 
			
		||||
G_STATIC_ASSERT(sizeof(RADIO_DATA_PROFILE_ID) == 4);
 | 
			
		||||
 | 
			
		||||
typedef enum radio_card_state {
 | 
			
		||||
    RADIO_CARD_STATE_ABSENT,
 | 
			
		||||
    RADIO_CARD_STATE_PRESENT,
 | 
			
		||||
@@ -258,6 +296,13 @@ typedef enum radio_capability_status {
 | 
			
		||||
} RADIO_CAPABILITY_STATUS;
 | 
			
		||||
G_STATIC_ASSERT(sizeof(RADIO_CAPABILITY_STATUS) == 4);
 | 
			
		||||
 | 
			
		||||
typedef enum radio_device_state {
 | 
			
		||||
    RADIO_DEVICE_STATE_POWER_SAVE_MODE,
 | 
			
		||||
    RADIO_DEVICE_STATE_CHARGING_STATE,
 | 
			
		||||
    RADIO_DEVICE_STATE_LOW_DATA_EXPECTED
 | 
			
		||||
} RADIO_DEVICE_STATE;
 | 
			
		||||
G_STATIC_ASSERT(sizeof(RADIO_DEVICE_STATE) == 4);
 | 
			
		||||
 | 
			
		||||
typedef struct radio_response_info {
 | 
			
		||||
    RADIO_RESP_TYPE type RADIO_ALIGNED(4);
 | 
			
		||||
    guint32 serial RADIO_ALIGNED(4);
 | 
			
		||||
@@ -333,11 +378,11 @@ typedef struct radio_operator_info {
 | 
			
		||||
G_STATIC_ASSERT(sizeof(RadioOperatorInfo) == 56);
 | 
			
		||||
 | 
			
		||||
typedef struct radio_data_profile {
 | 
			
		||||
    gint32 profileId RADIO_ALIGNED(4);
 | 
			
		||||
    RADIO_DATA_PROFILE_ID profileId RADIO_ALIGNED(4);
 | 
			
		||||
    GBinderHidlString apn RADIO_ALIGNED(8);
 | 
			
		||||
    GBinderHidlString protocol RADIO_ALIGNED(8);
 | 
			
		||||
    GBinderHidlString roamingProtocol RADIO_ALIGNED(8);
 | 
			
		||||
    gint32 authType RADIO_ALIGNED(4);
 | 
			
		||||
    RADIO_APN_AUTH_TYPE authType RADIO_ALIGNED(4);
 | 
			
		||||
    GBinderHidlString user RADIO_ALIGNED(8);
 | 
			
		||||
    GBinderHidlString password RADIO_ALIGNED(8);
 | 
			
		||||
    gint32 type RADIO_ALIGNED(4);
 | 
			
		||||
@@ -345,8 +390,8 @@ typedef struct radio_data_profile {
 | 
			
		||||
    gint32 maxConns RADIO_ALIGNED(4);
 | 
			
		||||
    gint32 waitTime RADIO_ALIGNED(4);
 | 
			
		||||
    guint8 enabled RADIO_ALIGNED(1);
 | 
			
		||||
    gint32 supportedApnTypesBitmap RADIO_ALIGNED(4);
 | 
			
		||||
    gint32 bearerBitmap RADIO_ALIGNED(4);
 | 
			
		||||
    RADIO_APN_TYPES supportedApnTypesBitmap RADIO_ALIGNED(4);
 | 
			
		||||
    RADIO_ACCESS_FAMILY bearerBitmap RADIO_ALIGNED(4);
 | 
			
		||||
    gint32 mtu RADIO_ALIGNED(4);
 | 
			
		||||
    gint32 mvnoType RADIO_ALIGNED(4);
 | 
			
		||||
    GBinderHidlString mvnoMatchData RADIO_ALIGNED(8);
 | 
			
		||||
@@ -651,6 +696,29 @@ typedef struct radio_activity_stats_info {
 | 
			
		||||
} RADIO_ALIGNED(4) RadioActivityStatsInfo;
 | 
			
		||||
G_STATIC_ASSERT(sizeof(RadioActivityStatsInfo) == 32);
 | 
			
		||||
 | 
			
		||||
typedef struct radio_hardware_config {
 | 
			
		||||
    gint32 type RADIO_ALIGNED(4);
 | 
			
		||||
    GBinderHidlString uuid RADIO_ALIGNED(8);
 | 
			
		||||
    gint32 state RADIO_ALIGNED(4);
 | 
			
		||||
    GBinderHidlVec modem RADIO_ALIGNED(8); /* vec<RadioHardwareConfigModem> */
 | 
			
		||||
    GBinderHidlVec sim RADIO_ALIGNED(8);   /* vec<RadioHardwareConfigSim> */
 | 
			
		||||
} RADIO_ALIGNED(8) RadioHardwareConfig;
 | 
			
		||||
G_STATIC_ASSERT(sizeof(RadioHardwareConfig) == 64);
 | 
			
		||||
 | 
			
		||||
typedef struct radio_hardware_config_modem {
 | 
			
		||||
    gint32 rilModel RADIO_ALIGNED(4);
 | 
			
		||||
    guint32 rat RADIO_ALIGNED(4);
 | 
			
		||||
    gint32 maxVoice RADIO_ALIGNED(4);
 | 
			
		||||
    gint32 maxData RADIO_ALIGNED(4);
 | 
			
		||||
    gint32 maxStandby RADIO_ALIGNED(4);
 | 
			
		||||
} RADIO_ALIGNED(4) RadioHardwareConfigModem;
 | 
			
		||||
G_STATIC_ASSERT(sizeof(RadioHardwareConfigModem) == 20);
 | 
			
		||||
 | 
			
		||||
typedef struct radio_hardware_config_sim {
 | 
			
		||||
    GBinderHidlString modemUuid RADIO_ALIGNED(8);
 | 
			
		||||
} RADIO_ALIGNED(8) RadioHardwareConfigSim;
 | 
			
		||||
G_STATIC_ASSERT(sizeof(RadioHardwareConfigSim) == 16);
 | 
			
		||||
 | 
			
		||||
/* c(req,resp,callName,CALL_NAME) */
 | 
			
		||||
#define RADIO_CALL_1_0(c) \
 | 
			
		||||
    c(2,1,getIccCardStatus,GET_ICC_CARD_STATUS) \
 | 
			
		||||
 
 | 
			
		||||
@@ -1,15 +1,18 @@
 | 
			
		||||
Name: libgbinder-radio
 | 
			
		||||
Version: 1.0.2
 | 
			
		||||
Version: 1.0.9
 | 
			
		||||
Release: 0
 | 
			
		||||
Summary: Binder client library for Android radio interfaces
 | 
			
		||||
Group: Development/Libraries
 | 
			
		||||
License: BSD
 | 
			
		||||
URL: https://github.com/mer-hybris/libgbinder-radio
 | 
			
		||||
Source: %{name}-%{version}.tar.bz2
 | 
			
		||||
 | 
			
		||||
%define libgbinder_version 1.0.9
 | 
			
		||||
 | 
			
		||||
BuildRequires: pkgconfig(glib-2.0)
 | 
			
		||||
BuildRequires: pkgconfig(libglibutil)
 | 
			
		||||
BuildRequires: pkgconfig(libgbinder) >= 1.0.9
 | 
			
		||||
Requires: libgbinder >= 1.0.9
 | 
			
		||||
BuildRequires: pkgconfig(libgbinder) >= %{libgbinder_version}
 | 
			
		||||
Requires: libgbinder >= %{libgbinder_version}
 | 
			
		||||
Requires(post): /sbin/ldconfig
 | 
			
		||||
Requires(postun): /sbin/ldconfig
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -59,6 +59,7 @@ struct radio_instance_priv {
 | 
			
		||||
    char* dev;
 | 
			
		||||
    char* slot;
 | 
			
		||||
    char* key;
 | 
			
		||||
    char* modem;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
G_DEFINE_TYPE(RadioInstance, radio_instance, G_TYPE_OBJECT)
 | 
			
		||||
@@ -70,6 +71,7 @@ enum radio_instance_signal {
 | 
			
		||||
    SIGNAL_OBSERVE_RESPONSE,
 | 
			
		||||
    SIGNAL_ACK,
 | 
			
		||||
    SIGNAL_DEATH,
 | 
			
		||||
    SIGNAL_ENABLED,
 | 
			
		||||
    SIGNAL_COUNT
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -79,6 +81,7 @@ enum radio_instance_signal {
 | 
			
		||||
#define SIGNAL_OBSERVE_RESPONSE_NAME   "radio-instance-observe-response"
 | 
			
		||||
#define SIGNAL_ACK_NAME                "radio-instance-ack"
 | 
			
		||||
#define SIGNAL_DEATH_NAME              "radio-instance-death"
 | 
			
		||||
#define SIGNAL_ENABLED_NAME            "radio-instance-enabled"
 | 
			
		||||
 | 
			
		||||
static guint radio_instance_signals[SIGNAL_COUNT] = { 0 };
 | 
			
		||||
 | 
			
		||||
@@ -320,7 +323,9 @@ RadioInstance*
 | 
			
		||||
radio_instance_create(
 | 
			
		||||
    const char* dev,
 | 
			
		||||
    const char* slot,
 | 
			
		||||
    const char* key)
 | 
			
		||||
    const char* key,
 | 
			
		||||
    const char* modem,
 | 
			
		||||
    int slot_index)
 | 
			
		||||
{
 | 
			
		||||
    RadioInstance* self = NULL;
 | 
			
		||||
    GBinderServiceManager* sm = gbinder_servicemanager_new(dev);
 | 
			
		||||
@@ -348,6 +353,8 @@ radio_instance_create(
 | 
			
		||||
            self->slot = priv->slot = g_strdup(slot);
 | 
			
		||||
            self->dev = priv->dev = g_strdup(dev);
 | 
			
		||||
            self->key = priv->key = g_strdup(key);
 | 
			
		||||
            self->modem = priv->modem = g_strdup(modem);
 | 
			
		||||
            self->slot_index = slot_index;
 | 
			
		||||
 | 
			
		||||
            priv->remote = remote;
 | 
			
		||||
            priv->client = gbinder_client_new(remote, iface);
 | 
			
		||||
@@ -400,6 +407,33 @@ RadioInstance*
 | 
			
		||||
radio_instance_new(
 | 
			
		||||
    const char* dev,
 | 
			
		||||
    const char* name)
 | 
			
		||||
{
 | 
			
		||||
    if (name && name[0]) {
 | 
			
		||||
        const char* modem;
 | 
			
		||||
        int slot;
 | 
			
		||||
 | 
			
		||||
        if (!g_strcmp0(name, "slot1")) {
 | 
			
		||||
            modem = "/ril_0";
 | 
			
		||||
            slot = 0;
 | 
			
		||||
        } else if (!g_strcmp0(name, "slot2")) {
 | 
			
		||||
            modem = "/ril_1";
 | 
			
		||||
            slot = 1;
 | 
			
		||||
        } else {
 | 
			
		||||
            GWARN("Unexpected slot '%s'", name);
 | 
			
		||||
            modem = NULL;
 | 
			
		||||
            slot = 0;
 | 
			
		||||
        }
 | 
			
		||||
        return radio_instance_new_with_modem_and_slot(dev, name, modem, slot);
 | 
			
		||||
    }
 | 
			
		||||
    return NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
RadioInstance*
 | 
			
		||||
radio_instance_new_with_modem_and_slot(
 | 
			
		||||
    const char* dev,
 | 
			
		||||
    const char* name,
 | 
			
		||||
    const char* modem,
 | 
			
		||||
    int slot) /* Since 1.0.7 */
 | 
			
		||||
{
 | 
			
		||||
    if (dev && dev[0] && name && name[0]) {
 | 
			
		||||
        char* key = radio_instance_make_key(dev, name);
 | 
			
		||||
@@ -412,7 +446,7 @@ radio_instance_new(
 | 
			
		||||
            g_free(key);
 | 
			
		||||
            return radio_instance_ref(self);
 | 
			
		||||
        } else {
 | 
			
		||||
            self = radio_instance_create(dev, name, key);
 | 
			
		||||
            self = radio_instance_create(dev, name, key, modem, slot);
 | 
			
		||||
            if (self) {
 | 
			
		||||
                if (!radio_instance_table) {
 | 
			
		||||
                    radio_instance_table = g_hash_table_new_full
 | 
			
		||||
@@ -593,6 +627,18 @@ radio_instance_send_request_sync(
 | 
			
		||||
    return FALSE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
radio_instance_set_enabled(
 | 
			
		||||
    RadioInstance* self,
 | 
			
		||||
    gboolean enabled) /* Since 1.0.7 */
 | 
			
		||||
{
 | 
			
		||||
    if (G_LIKELY(self) && self->enabled != enabled) {
 | 
			
		||||
        self->enabled = enabled;
 | 
			
		||||
        GDEBUG("%s %sabled", self->slot, enabled ? "en" : "dis");
 | 
			
		||||
        g_signal_emit(self, radio_instance_signals[SIGNAL_ENABLED], 0);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
gulong
 | 
			
		||||
radio_instance_add_indication_handler(
 | 
			
		||||
    RadioInstance* self,
 | 
			
		||||
@@ -665,7 +711,17 @@ radio_instance_add_death_handler(
 | 
			
		||||
    gpointer user_data)
 | 
			
		||||
{
 | 
			
		||||
    return (G_LIKELY(self) && G_LIKELY(func)) ? g_signal_connect(self,
 | 
			
		||||
        SIGNAL_ACK_NAME, G_CALLBACK(func), user_data) : 0;
 | 
			
		||||
        SIGNAL_DEATH_NAME, G_CALLBACK(func), user_data) : 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
gulong
 | 
			
		||||
radio_instance_add_enabled_handler(
 | 
			
		||||
    RadioInstance* self,
 | 
			
		||||
    RadioInstanceFunc func,
 | 
			
		||||
    gpointer user_data) /* Since 1.0.7 */
 | 
			
		||||
{
 | 
			
		||||
    return (G_LIKELY(self) && G_LIKELY(func)) ? g_signal_connect(self,
 | 
			
		||||
        SIGNAL_ENABLED_NAME, G_CALLBACK(func), user_data) : 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
@@ -721,6 +777,7 @@ radio_instance_finalize(
 | 
			
		||||
    g_free(priv->slot);
 | 
			
		||||
    g_free(priv->dev);
 | 
			
		||||
    g_free(priv->key);
 | 
			
		||||
    g_free(priv->modem);
 | 
			
		||||
    G_OBJECT_CLASS(radio_instance_parent_class)->finalize(object);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -761,6 +818,10 @@ radio_instance_class_init(
 | 
			
		||||
        g_signal_new(SIGNAL_DEATH_NAME, type,
 | 
			
		||||
            G_SIGNAL_RUN_FIRST, 0, NULL, NULL, NULL,
 | 
			
		||||
            G_TYPE_NONE, 0);
 | 
			
		||||
    radio_instance_signals[SIGNAL_ENABLED] =
 | 
			
		||||
        g_signal_new(SIGNAL_ENABLED_NAME, type,
 | 
			
		||||
            G_SIGNAL_RUN_FIRST, 0, NULL, NULL, NULL,
 | 
			
		||||
            G_TYPE_NONE, 0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user