Giter Club home page Giter Club logo

Comments (5)

pelya avatar pelya commented on July 21, 2024

You may try to apply this patch, it was adopted for newer kernel:

https://github.com/neobuddy89/hammerhead_kernel_caf/commit/5199daa72289c311c6d69f1b1c344e41ae8a7caa
On Jul 3, 2014 12:29 AM, "NeverUsedID" [email protected] wrote:

Hello,

iam having problems of comiling the kernel. The Patch had issues with
android.c, so i tried to fix it manualy. there are some light differences
in the android.c.

Now when i try to compile i get the following error:
../../../../../../kernel/samsung/hlte/drivers/usb/gadget/android.c: In
function 'functions_store':
../../../../../../kernel/samsung/hlte/drivers/usb/gadget/android.c:2758:16:
warning: passing argument 2 of 'android_enable_function' from incompatible
pointer type [enabled by default]
error, forbidden warning: android.c:2758
make[5]: *** [drivers/usb/gadget/android.o] Error 1
make[4]: *** [drivers/usb/gadget] Error 2
make[3]: *** [drivers/usb] Error 2

the section is and line 2758 is: " android_enable_function(dev, "hid");":

functions_store(struct device *pdev, struct device_attribute *attr,
const char *buff, size_t size)
{
struct android_dev *dev = dev_get_drvdata(pdev);
struct list_head *curr_conf = &dev->configs;
struct android_configuration *conf;
char *conf_str;
struct android_usb_function_holder *f_holder;
char *name;
char buf[256], *b;
int err;
int hid_enabled;

mutex_lock(&dev->mutex);

if (dev->enabled) {
        mutex_unlock(&dev->mutex);
        return -EBUSY;
}

/* Clear previous enabled list */
list_for_each_entry(conf, &dev->configs, list_item) {
        while (conf->enabled_functions.next !=
                        &conf->enabled_functions) {
                f_holder = list_entry(conf->enabled_functions.next,
                                typeof(*f_holder),
                                enabled_list);
                f_holder->f->android_dev = NULL;
                list_del(&f_holder->enabled_list);
                kfree(f_holder);
        }
        INIT_LIST_HEAD(&conf->enabled_functions);
}

strlcpy(buf, buff, sizeof(buf));
b = strim(buf);

while (b) {
        conf_str = strsep(&b, ":");
        if (conf_str) {
                /* If the next not equal to the head, take it */
                if (curr_conf->next != &dev->configs)
                        conf = list_entry(curr_conf->next,
                                          struct android_configuration,
                                          list_item);
                else
                        conf = alloc_android_config(dev);

                curr_conf = curr_conf->next;
        }






        while (conf_str) {
                name = strsep(&conf_str, ",");
                if (name) {

#ifdef CONFIG_USB_ANDROID_SAMSUNG_COMPOSITE
/* Enable ncm function

/ if (is_ncm_ready(name)) { printk(KERN_DEBUG "usb: %s ncm on\n",func);
err = android_enable_function(dev, conf, "ncm"); continue; } #endif err =
android_enable_function(dev, conf, name); if (err) pr_err("android_usb:
Cannot enable %s", name); if (!strcmp(name, "hid")) hid_enabled = 1; } } /

HID driver always enabled, it's the whole point of this kernel patch */
if (hid_enabled)
android_enable_function(dev, "hid");

}

/* Free uneeded configurations if exists */
while (curr_conf->next != &dev->configs) {
        conf = list_entry(curr_conf->next,
                          struct android_configuration, list_item);
        free_android_config(dev, conf);
}

mutex_unlock(&dev->mutex);

return size;

}

β€”
Reply to this email directly or view it on GitHub
#4.

from android-keyboard-gadget.

NeverUsedID avatar NeverUsedID commented on July 21, 2024

ahh thank you very much for the fast answer and the Link i will give the new one a try. Just found out which line of code the problem was:

its: android_enable_function(dev, "hid"); It should be android_enable_function(dev, conf, "hid");

from android-keyboard-gadget.

NeverUsedID avatar NeverUsedID commented on July 21, 2024

Okay, ive got it to work. Thank you very much for this great app.

Btw. is there a way to send clipboard from a bashscript to the connected computer ? Iam just starting with kernelcompiling and programming, so for me making an app which simple send the clipboard when its startet and ends himself is a very big project for me :)

edit: cant type german umlauts and special signs (f.e. Àâ #). is there a way to enhance this ?

from android-keyboard-gadget.

pelya avatar pelya commented on July 21, 2024

I've added description of the binary protocol to my github page few days
ago:
https://github.com/pelya/android-keyboard-gadget/

You can use this commandline tool to send key events:
https://github.com/pelya/android-keyboard-gadget/tree/master/hid-gadget-test

I don't know how to access Android clipboard from command line.

My app already has a clipboard button, if that will help you, you can just
take it's sources and butcher all other functionality from it.
On Jul 3, 2014 11:51 PM, "NeverUsedID" [email protected] wrote:

Okay, ive got it to work. Thank you very much for this great app.

Btw. is there a way to send clipboard from a bashscript to the connected
computer ? Iam just starting with kernelcompiling and programming, so for
me making an app which simple send the clipboard when its startet and ends
himself is a very big project for me :)

β€”
Reply to this email directly or view it on GitHub
#4 (comment)
.

from android-keyboard-gadget.

the-st0rm avatar the-st0rm commented on July 21, 2024

@NeverUsedID would you send me the patch files you used please. I also would like to make sure that you are using Samsung Note 3 with cyangonmod installed and you edited in the kernel code in /kernel/samsung/hlte/
right?

from android-keyboard-gadget.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.