export comms_formatRelayID via jni.

This commit is contained in:
Eric House 2015-07-11 14:25:16 -07:00
parent d6651a0404
commit 587f3b7630
2 changed files with 20 additions and 0 deletions

View file

@ -1817,6 +1817,25 @@ Java_org_eehouse_android_xw4_jni_XwJNI_comms_1isConnected
return result;
}
JNIEXPORT jstring JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_comms_1formatRelayID
( JNIEnv* env, jclass C, jint gamePtr, jint indx )
{
jstring result = NULL;
XWJNI_START_GLOBALS();
XP_UCHAR buf[64];
XP_U16 len = sizeof(buf);
if ( comms_formatRelayID( state->game.comms, indx, buf, &len ) ) {
XP_ASSERT( len < sizeof(buf) );
LOG_RETURNF( "%s", buf );
result = (*env)->NewStringUTF( env, buf );
}
XWJNI_END();
return result;
}
JNIEXPORT jstring JNICALL
Java_org_eehouse_android_xw4_jni_XwJNI_comms_1getStats
( JNIEnv* env, jclass C, jint gamePtr )

View file

@ -338,6 +338,7 @@ public class XwJNI {
public static native void comms_transportFailed( int gamePtr,
CommsConnType failed );
public static native boolean comms_isConnected( int gamePtr );
public static native String comms_formatRelayID( int gamePtr, int indx );
public static native String comms_getStats( int gamePtr );
// Dicts