Call ESP8266 SDK API function on SMING framework application - wifi

I am using ESP8266 WiFi chip and the SMING framework.
I would like to call SDK API function inside an app that uses the SMING framework.
Suppose I want to call wifi_station_set_reconnect_policy(true). How can I do this in a SMING application.cpp?

SMING is just a layer above the SDK, you can call it directly.
The method wifi_station_set_reconnect_policy is defined in the user_interface.h of the SDK, then you can call it in your application.cpp like this :
#include <user_config.h>
#include <SmingCore/SmingCore.h>
void init()
{
wifi_station_set_reconnect_policy(true);
}

Related

Verifone e355 iOS integration - unable to trigger barcode scanner with soft mode

I'm working in a POS(iPad) application where we are using Verifone E355 for payments. Now I have a requirement to trigger the barcode scanner of verifone e355 device(https://www.verifone.com/en/us/devices/mpos/e355) through software from iPad.
VMF(Verifone mobile framework) iOS sdk is being used to communicate calls with E355.
I have followed the framework docs and initialised the barcode scanner API. To activate the barcode scanner and scan the below code snippet is used.
I always get a return of -9 (which is an error code, description as per docs - Value returned when command was sent when device is connected but not connection not initialized) upon calling startScan and sendTriggerEvent: api's.
[self.barcodeScanner initDevice];
int startScanResult = [self.barcodeScanner startScan]
int setSoftTrigger = [self.barcodeScanner sendTriggerEvent:true];
The above code block is what I have tried till now. If anyone has experience working with e355 integration, please help out here.
you need to confirm to the delegate of VFIBarcode and once you scan you will get response from barcodeScanData delegate method.

CallKit Extension in IOS

i have a scenario like fetching the contacts from contacts framework and picking the selected contacts from the contacts framework and passing the selected list of contacts(array) to CALLKIT.
Once i get a call from any of the selected(which i picked earlier from contacts framework and passed it to call kit extension)...my bluetooth device has to vibrate(generally notifying the user)
i would like to know...whether we can pass array(selected contacts) to call kit extension and get notified if we get a call from the array(selected contacts) which we passed to call kit extension method
(BOOL)addIdentificationPhoneNumbersToContext:(CXCallDirectoryExtensionContext *)context;
Unfortunately, this is definitely not possible with the current iOS 10.x CallKit API. It appears to be a security/privacy thing based on how they designed things.

WeMo Local SDK Demo iOS App DidFoundDevice Never Called

I downloaded 2 third party apps capable of controlling my WEMO Link and they detected my 2 WeMo LED Bulbs straight away. However, when I downloaded the WeMo SDK Demo app, it never detects anything. the DidFoundDdevice delegate method is never called. I have no idea why..
I tried contacting weMo Developers and they replied once and never again.
Please follow Below Process
1.import #import "WeMoDiscoveryManager.h"
2.Define a Delegate in .h file of your view controller and create object of WeMoDiscoveryManager
#interface ViewController : UIViewController<WeMoDeviceDiscoveryDelegate>
{
WeMoDiscoveryManager* discoveryManager;
}
Write below code in viewDidLoad
discoveryManager = [WeMoDiscoveryManager sharedWeMoDiscoveryManager];
discoveryManager.deviceDiscoveryDelegate = self;
[discoveryManager discoverDevices:WeMoUpnpInterface];
write Wemodiscovermanager delegate methods
-(void)discoveryManager:(WeMoDiscoveryManager*)manager didFoundDevice:(WeMoControlDevice*)device
}
-(void)discoveryManager:(WeMoDiscoveryManager*)manager removeDeviceWithUdn:(NSString*)udn {
}
-(void)discoveryManagerRemovedAllDevices:(WeMoDiscoveryManager*)manager
}
and keep break point on didFoundDevice
Note : before implementing this please check
a.weather devices configured or not
b.your wemo devices and your mobile should be in same network (wemo devices doesn't have remote access)

Log Objective-c message sends on a device

When running an iOS app in the simulator, there's an environment variable NSObjCMessageLoggingEnabled that causes all objc_msgSend calls to be logged out to a file. (Detailed explanation).
I'm trying to trace out all the messages that are being sent in my app, but I can't run it in the simulator. It has to be on a physical device because I'm interacting with hardware through the lightning connector. For the same reason, I can't attach a debugger to the process.
It would be helpful to write a log to disk like the one created with NSObjCMessageLoggingEnabled, but write it locally in my app's Documents directory, or similar.
Is this possible?
All NSObjCMessageLoggingEnabled does is cause CoreFoundation to automatically call instrumentObjcMessageSends at startup and shutdown.
The problem is that Apple has intentionally hidden that function in the native iOS SDK, so you can't just call it.
But it still exists in the dylib at runtime, so you can always do this:
#include <dlfcn.h>
typedef void functype(BOOL);
void *libobjc = dlopen("/usr/lib/libobjc.dylib", RTLD_LAZY);
functype *instrumentObjcMessageSends = dlsym(libobjc, "instrumentObjcMessageSends");
if (!instrumentObjcMessageSends) {
NSLog(#"Couldn't get instrumentObjcMessageSends");
exit(1);
}
instrumentObjcMessageSends(YES);
NSLog(#"Did it");
I have no idea where, if anywhere, the logs are being written to. I assume you're going to want to call logObjcMessageSends to register your own ObjCLogProc, as explained in the post you linked to.

Is it possible to detect LTE connection using iOS SDK?

I'm using the reachability API to detect my current connection, but I can only distinguish between WIFI and 3G.
I get the following flags:
LTE: kSCNetworkReachabilityFlagsIsLocalAddress|kSCNetworkReachabilityFlagsIsWWAN|kSCNetworkReachabilityFlagsTransientConnection|kSCNetworkReachabilityFlagsReachable
WIFI: kSCNetworkReachabilityFlagsIsDirect|kSCNetworkReachabilityFlagsReachable
The problem is that LTE returns the same flags as a 3G connection. Is there any way to determine whether the user currently has LTE or 3G?
As of iOS 7, you can find this out using the currentRadioAccessTechnology property of CTTelephonyNetworkInfo in the CoreTelephony framework.
#import <CoreTelephony/CTTelephonyNetworkInfo.h>
CTTelephonyNetworkInfo *networkInfo = [CTTelephonyNetworkInfo new];
if ([networkInfo.currentRadioAccessTechnology isEqualToString:CTRadioAccessTechnologyLTE]) {
// ...
}
I wonder if this hidden Core Telephony API can provide you with enough info for you to determine whether you're attached to an LTE or a slower technology.
CTRegistrationGetCurrentMaxAllowedDataRate();
It might be worth experimenting with.
More about using private APIs here: iPhone mobile number using Core telephony
However, I've read that your app will be rejected by apple if you use private APIs.

Resources