BBBAndroidHAL  V1.0
 All Classes Files Functions Variables Macros
Macros | Functions
jni_wrapper.c File Reference

JNI general purpose interface code for bbbandroidHAL. More...

#include <jni.h>
#include <string.h>
#include <stdio.h>
#include <android/log.h>
#include "bbbandroidHAL.h"

Macros

#define JAVA_CLASS_PATH(funtion_name)   Java_com_bbbandroid_gpio_MainActivity_##funtion_name
 
#define BBBANDROID_NATIVE_TAG   "NDK_BBBAndroidApplication"
 
#define BUFFER_SIZE   64
 

Functions

jboolean JAVA_CLASS_PATH() openGPIO (JNIEnv *env, jobject this)
 
void JAVA_CLASS_PATH() closeGPIO (JNIEnv *env, jobject this)
 
jboolean JAVA_CLASS_PATH() readGPIO (JNIEnv *env, jobject this, jint header, jint pin)
 
void JAVA_CLASS_PATH() writeGPIO (JNIEnv *env, jobject this, jint header, jint pin, jint val)
 
jboolean JAVA_CLASS_PATH() pwmSetPeriod (JNIEnv *env, jobject this, jint channel, jint period_ns)
 
jint JAVA_CLASS_PATH() pwmGetPeriod (JNIEnv *env, jobject this, jint channel)
 
jboolean JAVA_CLASS_PATH() pwmSetDutyCycle (JNIEnv *env, jobject this, jint channel, jint duration_ns)
 
jint JAVA_CLASS_PATH() pwmGetDutyCycle (JNIEnv *env, jobject this, jint channel)
 
jboolean JAVA_CLASS_PATH() pwmSetPolarity (JNIEnv *env, jobject this, jint channel, jint polarity)
 
jint JAVA_CLASS_PATH() pwmGetPolarity (JNIEnv *env, jobject this, jint channel)
 
jboolean JAVA_CLASS_PATH() pwmRun (JNIEnv *env, jobject this, jint channel)
 
jboolean JAVA_CLASS_PATH() pwmStop (JNIEnv *env, jobject this, jint channel)
 
jint JAVA_CLASS_PATH() pwmRunCheck (JNIEnv *env, jobject this, jint channel)
 
jint JAVA_CLASS_PATH() readADC (JNIEnv *env, jobject this, jint channel)
 
jint JAVA_CLASS_PATH() i2cOpenAdaptor (JNIEnv *env, jobject this, jint adaptorNumber)
 
jboolean JAVA_CLASS_PATH() i2cSetSlave (JNIEnv *env, jobject this, jint i2cFD, jint address)
 
jboolean JAVA_CLASS_PATH() i2cWriteByte (JNIEnv *env, jobject this, jint i2cFD, jbyte add, jbyte byte)
 
jboolean JAVA_CLASS_PATH() i2cWriteBytes (JNIEnv *env, jobject this, jint i2cFD, jbyte add, jint length, jbyteArray barray)
 
jint JAVA_CLASS_PATH() i2cReadByte (JNIEnv *env, jobject this, jint i2cFD, jbyte add)
 
jboolean JAVA_CLASS_PATH() i2cReadBytes (JNIEnv *env, jobject this, jint i2cFD, jbyte add, jint length, jintArray barray)
 
void JAVA_CLASS_PATH() i2cClose (JNIEnv *env, jobject this, jint i2cFD)
 
jint JAVA_CLASS_PATH() spiOpen (JNIEnv *env, jobject this, jint bus, jint device, jint speed, jint mode, jint bpw)
 
jint JAVA_CLASS_PATH() spiWriteByte (JNIEnv *env, jobject this, jint spiFD, jbyte data)
 
void JAVA_CLASS_PATH() spiClose (JNIEnv *env, jobject this, jint spiFD)
 
jint JAVA_CLASS_PATH() uartOpen (JNIEnv *env, jobject this, jint device, jint bdrate)
 
jboolean JAVA_CLASS_PATH() uartWrite (JNIEnv *env, jobject this, jint uartFD, jint length, jbyteArray barray)
 
jboolean JAVA_CLASS_PATH() uartRead (JNIEnv *env, jobject this, jint uartFD, jint length, jintArray barray)
 
void JAVA_CLASS_PATH() uartClose (JNIEnv *env, jobject this, jint uartFD)
 
jint JAVA_CLASS_PATH() canOpenRaw (JNIEnv *env, jobject this, jstring port)
 
jboolean JAVA_CLASS_PATH() canSendBytes (JNIEnv *env, jobject this, jint canFD, jint length, jbyteArray barray)
 
jbyteArray JAVA_CLASS_PATH() canReadBytes (JNIEnv *env, jobject this, jint canFD)
 
void JAVA_CLASS_PATH() canClose (JNIEnv *env, jobject this, jint canFD)
 
jint JAVA_CLASS_PATH() usbInit (JNIEnv *env, jobject this)
 
jboolean JAVA_CLASS_PATH() usbGetDevices (JNIEnv *env, jobject this, jobjectArray idArray, jobjectArray stringsArray)
 
void JAVA_CLASS_PATH() usbClose (JNIEnv *env, jobject this)
 

Detailed Description

JNI general purpose interface code for bbbandroidHAL.

Author
Ankur Yadav (ankur.nosp@m.ayad.nosp@m.av@gm.nosp@m.ail..nosp@m.com)