Wahoo API Integration in iOS - ios

I have integrated wahoo api in iOS. I need to get WFHeartrateData for WFFitnessEquipmentConnection.
But not able to test without real adaptor. Is there any way i can test using iPhone device or other way?
Please find the below work in progress code implementation:
Add parameter WF_SENSORTYPE_FITNESS_EQUIPMENT for startDiscovery and implement WFFitnessEquipmentConnection (FE-C).
Create a new object for WFFitnessEquipmentConnection and make connection to sensor using below method:
requestSensorConnection:deviceParams withProximity:WF_PROXIMITY_RANGE_DISABLED error:&error
Tried to get the data WFFitnessEquipmentData and WFFitnessEquipmentRawData from fitness equipment connection.
WFFitnessEquipmentData* hrData = [self.fitnessEquipmentConnection getFitnessEquipmentData];
WFFitnessEquipmentRawData* hrRawData = [self.fitnessEquipmentConnection getFitnessEquipmentRawData];

Related

Multiple user Video Call using WebRTC SDK Directly

Hi I am working on a Video Call Solution by using WebRTC directly. I have achieved 1-1 video call using firebase as Signaling service and using default google ICE Servers.
Core Req: Multiple users with in a Room using WebRTC at least 4 users using the default ice/stun servers available. I'm using pod 'GoogleWebRTC'
Issue comes when multiple users joins the same room ID.
So, I am maintaining Peerconnection reference as this
var peerConnection: RTCPeerConnection! = nil
When a new user i.e., remote user joins I set its description as below
self.peerConnection.setRemoteDescription(offer, completionHandler: {(error: Error?) in
if error == nil {
LOG("setRemoteDescription(offer) succsess")
self.makeAnswer() // Create Answer if setRemoteDescription succeeds
} else {
LOG("setRemoteDescription(offer) ERROR: " + error.debugDescription)
}
})
What I feel ? Issue is when third user joins again I set the remote Description with above mentioned code which makes my previous video stops to render sometimes or most of the times.
I looked for solutions and found need to maintain multiple peer connection references, but how? Any help with my requirement will be appreciated.
Just give me clue or sample code will be really great.
In case of multiple user call you should have multiple peerconnections, because it's isn't possible to set different sdps to one pc.
So you can use something like this
var peerConnectionMap = [String: RTCPeerConnection]()
Where String here is some constant user id.
When new user is joined to the room, then you create new pc and store it in this dictionary. Then you exchange with sdps as usual.
Don't forget that you should reuse local audio-video track created when first peerconnection is created.

Get all options from Android Spinner using Appium

I am trying to pull all the options off an android spinner, using Appium. With Selenium, you can use the Select object and do something like getOptions (I forget the exact syntax). I need the text from all the options in the spinner.
Considering the spinner options are accessible through Appium. Getting all the values of the options on the spinner shall work as follows :
List<WebElement> spinnerList = driver.findElements(getBy("identifier")); //where identifier would vary on how you can access the elements
String spinnerListElementText[index]; //e.g. to store Text of all the options
for (int index = 0; index < spinnerList.size(); index++) {
String spinnerListElementText[index] = spinnerList.get(index).getText();
}
In Appium, there are test frameworks called Uiautomator, Uiautomator2 and Espresso, respectively. The thing that you were trying to get is not provided by Uiautomator or Uiautomator2 test frameworks. The only way with those frameworks is to click the spinner and get page source of spinner with visible elements. You could try to use Espresso framework. This is the reason:
Uiautomator: It is a test framework which provides a black-box testing for developers. It means that you can not get internal codes of the application.
Espresso: It is a test framework which provides a grey-box testing for developers. It means that you can get internal codes of the application, find elements which are not visible in the page (off-screen elements).
Try to use Espresso framework in Appium.

Trying to store some bytes sent from my iOS app into a variable in my Arduino sketch

I’m currently writing an iOS app that passes strings to the Arduino via Bluetooth Low Energy (BLE). I’m using RedBearLab’s BLE shield and my code for iOS and Arduino are based on their open source code from their GitHub https://github.com/RedBearLab/iOS.
The problem I’m having is I don’t know how to store the NSData that I sent from my iOS app via BLE to a variable in my Arduino’s sketch.
Here is my iOS code:
#import “BLE.h” // from RedBearLab’s Github
- (IBAction)sendText:(id)sender
{
NSData *textInput = [self.textField.text dataUsingEncoding:NSUTF8StringEncoding];
if (ble.activePeripheral.state == CBPeripheralStateConnected) {
[ble write:textInput]; // ble is a object that follows the CoreBluetooth protocol written by RedBearLab
NSLog(#"Date sent..");
}
}
Here you can find the write:(NSData *)d method from the BLE.m
My Arduino has no problem receiving my textInput. Now let say my textInput is “Hello”. Arduino’s serial monitor will show the following message when I run the Arduino’s sketch provided by RedBearLab SimpleChat.ino:
Evt Device Started: Standby
Advertising started
Evt Connected
Evt Pipe Status
Evt Pipe Status
Pipe Number: 2
Hello // <--------my inputString
Evt link connection interval changed
So by looking at the serial monitor, my Arduino have no problem receiving my NSData from my iOS app. However, I have no idea how to store Hello into a variable (preferably a char[]) so I could put it into another function in my own Arduino sketch. If you look at the SimpleChat.ino, the program has a line which is Serial.write(ble_read());. I know I have to store the result of ble_read() into a variable, but I have no idea what type I should use to store the variable. According to the ble_shield.cpp, the ble_read() function returns a int, but what I really want is something like char[] so it can represent the textInput. Can someone familiar with C and Arduino help me out? Thanks.

For plug in running on iOS

What I want to implement is as follow:
A-app (calling app) : request the return value of a-string sent as parameter : request(a-string) -> b-string.
B-app (plug-in installed separately by me or others, it plays the role of dictionary or database ) : search a-string from database and return the result (b-string).
With successful experiences of plug-in on android and with Apple's confident rhetoric of plug-in, I thought plug-in, of course, run on iOS. After a lot of hard work, however, I finally found out:
* Note : The creation and use of loadable bundles is not supported in iOS.*
Nonetheless, not giving up, I finally made it with custom URl and pasteboard:
A-app : write a-string and false state to pasteboard & call B-app via custom URL.
B-app : viewDidLoad runs following func and thereafter exit program ; func { read pasteboard and search from database & write the result(b-string) and true state to pasteboard }
A-app : while-loop detects whether state is false or true. if true, catch b-string from pasteboard.
Anyway it works but it's too long thus almost useless. Do you have any idea for better solutions? Why doesn't Apple allow plug-in for iOS? Any responses are welcome. Thank you.
I can't answer why Apple doesn't allow plug-ins, but I can offer some advice on what you're trying to achieve.
The common pattern for sending data back to your application is to implement a callback url, so the A-app would also implement a custom URI and add that to the uri sent to B-app.
B-app would then process the uri as you have already implemented, but then instead of exiting, it simply sends the data you requested in the uri passed to it.
See http://x-callback-url.com for more details and example implementations.

Get Location with Mvvmcross

I'm trying to get location in my application (mvvmcross/monodroid)
I follow this post : http://slodge.blogspot.be/2012/04/getting-location-information-in.html
I'm using Vnext version.
When I try to get location I have this message in output : "Location Service Provider unavailable - returned null".
I have this code to initialise location plugin in App.cs :
protected override void InitialisePlugIns()
{Cirrious.MvvmCross.Plugins.Location.PluginLoader.Instance.EnsureLoaded();}
And in my ViewModel I follow the sample. I have to get location when I'm on the view so I added this code in my ViewModel constructor :
_watcher = this.GetService<IMvxGeoLocationWatcher>();
DoStartStop();
I did somthing wrong I have this message ?
edit: I use Samsung Galaxy Tab 2.0 7"
I'm not sure what the problem might be, but some things to try are:
does your device definitely have gps? And is it enabled?
does your test app have coarse and fine capabilities declared in the manifest file?
does another app work? Eg the mvx tutorial app with its location view?

Resources