How to use Movesense SendUartData - movesense

BleController.hpp has SendUartData. Should this work with 1.1.0? I can call send_ble_hr_measurement and get OnUartData notifications ok but not sure how to call SendUartData instead of send_ble_hr_measurement in ble_std_services examples.

Unfortunally BleController::SendUartData() has bug and not working properly in 1.1.0. This bug is corrected in revision 1.2.0 which is just coming, but this method is deleted and replaced by public function void send_ble_nus_data(uint8_t * p_data, uint16_t length);

Related

Flutter on VS Code issue: StreamController.Sink.add() suddenly require argument PUSH

Good afternoon good people,
I'm suddenly experiencing a problem with VS Code:
in a couple of Flutter apps Streamcontroller.sink.add();
suddenly require the argument "push" (before it didn't).
without adding the push argument obviously it return the error
2 required argument(s) expected, but 1 found.dart(not_enough_required_arguments)
Does anyone know what might have happened?
thank you in advance for your help
Francesco
edit: via f12 the definition actually shows the argument push
part of dart.core;
/**
* A generic destination for data.
*
* Multiple data values can be put into a sink, and when no more data is
* available, the sink should be closed.
*
* This is a generic interface that other data receivers can implement.
*/
abstract class Sink<T> {
/**
* Adds [data] to the sink.
*
* Must not be called after a call to [close].
*/
void add(T data, Future push);
/**
* Closes the sink.
*
* The [add] method must not be called after this method.
*
* Calling this method more than once is allowed, but does nothing.
*/
void close();
}
but as pskink reminded the documentation doesn't show this requirement;
I don't have idea how this can have changed,
at this point the question is:
how do I restore it to normality?
TL;DR
what appeared to be bad code,
was instead corrupted dart code;
I followed the instruction provide by Gunter
and everything went back to normal.
Thanks again Gunter

Unity WebGL - Locating code that triggers Reflection.emit

I've run into the dreaded Reflection.emit issue in my webplayer build and am unable to locate what is triggering it. I'm currently commenting out code method by method and rebuilding to locate the cause and have narrowed it down to the below.
I'm not using JSON so the various JSON libraries aren't the cause, nor any of the other result suggestions returned by google.
How can i more easily go about locating the cause of this error. I have full stack trace on and well as full debugging, but all i get is the following console output.
NotSupportedException: C:\Program Files\Unity 2018.2.0b2\Editor\Data\il2cpp\libil2cpp\icalls\mscorlib\System.Reflection.Emit\AssemblyBuilder.cpp(20) : Unsupported internal call for IL2CPP:AssemblyBuilder::basic_init - System.Reflection.Emit is not supported.
Rethrow as TypeInitializationException: The type initializer for 'System.Reflection.Emit.DynamicMethod.AnonHostModuleHolder' threw an exception.
//NOTE: appM.procM is a C# .Net 4.x dynamic variable EG:
//public dynamic procM = GetProcClass(strProcName)
public void ShowProcList() {
/* Rest of method commented out*/
if(appM.procM == null){
procList.Initialize(appM.procM.lstNames, this);
}
/* Rest of method commented out*/
}
public void Initialize(List<string> lstNames, UIM um, string currProc=null) {
uiM = um;
//cleanup of the list before populating
foreach(Transform fld in Panel.transform) {
Destroy(fld.gameObject);
}
/* Rest of method commented out*/
}
Update: I narrowed down the problem line of code, but haven't closed the question as there's got to be an easier way than commenting out line by line and rebuilding.
For future searchers, the issue is the if(appM.procM == null) check. As procM is a dynamic variable reflection is used which kills AOT in webGL builds. No compiler warnings were generated to save myself from myself.
Nevermind, i am an idiot, The option Enable Exceptions under Player Settings was set to Full Without Stacktrace and not Full with Stacktrace.
The value Full With Stacktrace contains the pertinent data. Easily locatable in the browsers console. Warning that full debugging does increase build times and slow down the application.

JcrPackage getSize() is always 0

In my code (AEM 6.1 SP 1) I build packages programmatically. All works fine, except that I want to log the package size - and whatever I tried, it was always 0.
Here's a current code snippet:
OutputStream out = new FileOutputStream(backupPath + "/" + fileName);
JcrPackageManager packageManager = packaging.getPackageManager(resolver.adaptTo(Session.class));
packageManager.assemble(jcrPackage.getDefinition(), listener, out);
logger.trace("Package size is {}.", jcrPackage.getSize());
I tried to close the package and reopen it afterwards, I committed the resource resolver, refreshed the session, but the result was the same.
Any ideas?
The way getSize works for JcrPackageImpl is that it looks for the "jcr:content" node on the path of the package and tries to get the property "jcr:data" and the length of this property value is returned in the size.
Can you confirm if the path/node you are trying to store the package is "jcr:content" node, My assumption is that its not, thats why you are getting 0 in the package size.
After much trial and error and the hints from Ameesh and Abhishek I found out what the problem was:
assemble(JcrPackageDefinition definition,
ProgressTrackerListener listener, OutputStream out)
does in fact not store the assembled package in the repository. That's why the size is 0. The package is passed to the OutputStream instead - which, in my case, saved the package to disk.

Recent gyroscope support from Corona SDK seems to be non-responsive

I'm using a recent daily build of the Corona SDK (version 2001.562) to add gyroscope support to an existing application. Unfortunately, I can't seem to get the event-handling function for the gyroscope to fire. The application is running on an iPod touch, version 4.3.3.
I attach the gyroscope to an event handler like so:
if system.hasEventSource("gyroscope") then
feedbackFile = io.open(system.pathForFile("log.txt", system.DocumentsDirectory), "a");
feedbackFile:write((os.clock()-startupTime).."\tgyroscope on\n");
io.close(feedbackFile);
Runtime:addEventListener( "gyroscope", onGyroscopeDataReceived )
else
feedbackFile = io.open(system.pathForFile("log.txt", system.DocumentsDirectory), "a");
feedbackFile:write((os.clock()-startupTime).."\tgyroscope off\n");
io.close(feedbackFile);
end
When I launch the application on the device, then close it and download the resource files, I find that log.txt contains the line with a timestamp and "gyroscope on". Good so far!
On to the event-handling function:
local function onGyroscopeDataReceived(event)
feedbackFile = io.open(system.pathForFile("log.txt", system.DocumentsDirectory), "a");
feedbackFile:write((os.clock()-startupTime).."\tgyroscope reading delta="..event.deltaRotation..",x="..event.xRotation..",y="..event.yRotation..",z="..event.zRotation.."\n");
io.close(feedbackFile);
end
This line of information never appears in the log.txt file!
Please advise. Thanks in advance!
The problem is event.deltaRotation doesn't exist. You might mean event.deltaTime.
Then when you concatenate a nil value, Lua throws an error and your write code never gets completed. (The latest daily build will now print out a message when you encounter a Lua error on a device.)
The documentation shows how to compute your own deltaDegrees or deltaRadians:
http://developer.anscamobile.com/reference/index/events/gyroscope/eventxrotation
Just a wild guess but it may be your listener is never called --- I noticed your onGyroscopeDataReceived function is local. If that's the case, then you need to make sure the variable is declared prior to the addEventListener call.

ShellToast.NavigationUri ignored - the toast takes me to MainPage.xaml // WP7.1 Mango

I've been playing with the background tasks and everything is fine (but bizzar), but now I try to do something like this:
protected override void OnInvoke(ScheduledTask task)
{
if (task is PeriodicTask)
{
ShellToast t = new ShellToast();
t.Content = "AAAAAAAAAAAAAAAAAAAAA";
t.Title = "mytitle";
t.NavigationUri = new Uri("/GotHereFromToastLink.xaml?someParam=" + 123, UriKind.Relative);
t.Show();
}
NotifyComplete();
}
Which SHOULD take me to GoHereFromToastLink.xaml when I press the toast notification, but instead it always takes me to MainPage.xaml - anybody knows if this is a bug? Or am I doing something incorrectly?
After contacting some really helpful MS guys I got a response - It's a known issue (aka bug) and it's already fixed but they don't have a date on the update to the Mango SDK but this will be working properly in the final release of the Mango toolset.
So for now - just ignore it.
I have the same problem!
Found out that the reason is the relative URI. I assume you have used another absolute URI in your application?