Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Add Android gadget manufacturer and vendor id support
Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
- Loading branch information
1 parent
af3a30b
commit 26febfc
Showing
6 changed files
with
137 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/** | ||
@file usb_moded-android.c | ||
Copyright (C) 2013 Jolla. All rights reserved. | ||
@author: Philippe De Swert <philippe.deswert@jollamobile.com> | ||
This program is free software; you can redistribute it and/or | ||
modify it under the terms of the Lesser GNU General Public License | ||
version 2 as published by the Free Software Foundation. | ||
This program is distributed in the hope that it will be useful, but | ||
WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
General Public License for more details. | ||
You should have received a copy of the Lesser GNU General Public License | ||
along with this program; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
02110-1301 USA | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <glib.h> | ||
|
||
#include "usb_moded-android.h" | ||
#include "usb_moded-log.h" | ||
#include "usb_moded-modesetting.h" | ||
#include "usb_moded-config.h" | ||
|
||
/** check if android settings are set | ||
* | ||
* @return 1 if settings are available, 0 if not | ||
* | ||
*/ | ||
int android_settings(void) | ||
{ | ||
int ret = 0; | ||
|
||
ret = check_android_section(); | ||
|
||
return ret; | ||
} | ||
|
||
/** initialize the basic android values | ||
*/ | ||
void android_init_values(void) | ||
{ | ||
const char *text; | ||
|
||
text = get_android_manufacturer(); | ||
if(text) | ||
{ | ||
write_to_file("/sys/class/android_usb/android0/iManufacturer", text); | ||
g_free((char *)text); | ||
} | ||
text = get_android_vendor(); | ||
if(text) | ||
{ | ||
write_to_file("/sys/class/android_usb/android0/idVendor", text); | ||
g_free((char *)text); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
@file usb_moded-android.h | ||
Copyright (C) 2013 Jolla. All rights reserved. | ||
@author: Philippe De Swert <philippe.deswert@jollamobile.com> | ||
This program is free software; you can redistribute it and/or | ||
modify it under the terms of the Lesser GNU General Public License | ||
version 2 as published by the Free Software Foundation. | ||
This program is distributed in the hope that it will be useful, but | ||
WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
General Public License for more details. | ||
You should have received a copy of the Lesser GNU General Public License | ||
along with this program; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
02110-1301 USA | ||
*/ | ||
|
||
int android_settings(void); | ||
void android_init_values(void); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters