Bug 1635 - EASession Handle Stream Event
Summary: EASession Handle Stream Event
Status: RESOLVED INVALID
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 5.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2011-10-21 10:27 UTC by Imran
Modified: 2012-04-04 10:09 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
The attachemnet contains the sample project tryingto print ot connected printer using EASession (7.32 MB, application/x-zip-compressed)
2011-10-21 10:27 UTC, Imran
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description Imran 2011-10-21 10:27:34 UTC
Created attachment 750 [details]
The attachemnet contains the sample project tryingto print ot connected printer using EASession

I am developing an  iPhone app, in which I am trying to print a content to the connected accessory (i.e printer) via cable or BlueTooth.

This code was working fine for both printer connected via cable or Bluetooth.

Now I have updated my iOS version to 5.0 and now the same is working only for cable and some times for Bluetooth. If I press the print button 8-10 times the Bluetooth printer prints once.

I have attached a sample project which contains various methods i have used and was not working for me.

Also I wanted to handle the Stream Event 

                NSStreamOpenCompleted
                HasByteAvailable
                HasSpaceAvailabe
                ErrorOccurred
                Etc

So I have created a class 

Class MyStream : NSStreamDelegate
{

                Public override void HandleEvent(NSStream  stream, NSStreamEvent event)
                {
                                Switch(event)
                                {
                                                NSStreamOpenCompleted :
                                                HasByteAvailable : 
                                                HasSpaceAvailabe : 
                                                ErrorOccurred : 
}
}
}


And I have used the code like 

Session.OutputStream.Delegate = new MyStream()

And also I have tried 

Session.OutputStream.OnEvent += delegate (object sender, NSStreamEventargs e)
        {
                                                Switch(e.StreamEvent)
                                                {
                                                                NSStreamOpenCompleted :
                                                                HasByteAvailable : 
                                                                HasSpaceAvailabe : 
                                                                ErrorOccurred : 
}
        }


But this Event never fire, I have added an Alter for each event, but none of the event fires event the default case doesn’t fir, means that this event is not at all called by the NSOutputStream, how can I enable this events.
I have to handle  a
Comment 1 Rolf Bjarne Kvinge [MSFT] 2012-04-04 10:09:18 UTC
You need to list the external accessories you're going to use in your Info.plist.

There is some documentation on this on apple's site: http://developer.apple.com/library/ios/#featuredarticles/ExternalAccessoryPT/Introduction/Introduction.html#//apple_ref/doc/uid/TP40009502

Here is a screenshot of how to set this value in Info.plist: http://screencast.com/t/AYmOWjf8wkL