• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
OTOptionManagement help?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

OTOptionManagement help?


  • Subject: OTOptionManagement help?
  • From: Dylan Barrie <email@hidden>
  • Date: Sat, 30 Nov 2002 22:56:43 -0800

I'm trying to set an endpoint I've created to be a "raw" endpoint, and the code I'm using seems to set it correctly, but I can not get the value back after its been set...

Here's the code:

OSStatus err;
TOption option;
TOptMgmt req, ret;

// Start up Open Transport
err = InitOpenTransportInContext (kInitOTForApplicationMask, NULL);
ThrowIfOSErr_ (err);

// make a configuration for communicating with the Xbox and open an endpoint
ep = OTOpenEndpointInContext (OTCreateConfiguration (kEnetName), 0, NULL, &err, NULL);
ThrowIfOSErr_ (err);

// set raw mode
option.len = kOTFourByteOptionSize;
option.level = LNK_TPI;
option.name = OPT_SETRAWMODE;
option.status = 0;
option.value[0] = kOTRawRcvOn;
req.opt.buf = (UInt8 *) &option;
req.opt.len = sizeof (option);
req.flags = T_NEGOTIATE;
ret.opt.buf = (UInt8 *) &option;
ret.opt.maxlen = sizeof (option);

err = ep->OptionManagement (&req, &ret);
ThrowIfOSErr_ (err);

if (option.status != T_SUCCESS)
ThrowIfOSErr_ (option.status);

option.len = kOTOptionHeaderSize;
option.level = LNK_TPI;
option.name = OPT_SETRAWMODE;
option.status = 0;
option.value[0] = 0;
req.opt.buf = (UInt8 *) &option;
req.opt.len = kOTOptionHeaderSize;
req.flags = T_CURRENT;
ret.opt.buf = (UInt8 *) &option;
ret.opt.maxlen = sizeof (option);

err = ep->OptionManagement (&req, &ret);
ThrowIfOSErr_ (err);

if (option.status != T_SUCCESS)
ThrowIfOSErr_ (option.status);

SignalString_ (LStr255 ((long)*(UInt32 *)option.value));

(I'm using PowerPlant)

The second call to OptionManagement always returns -3151, and I haven't been able to figure out what I'm doing wrong.

Any help would be GREATLY appreciated!

Dylan Barrie
Postpose.com
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: InternetConfig incompatibility between 10.2 and 10.1?
  • Previous by thread: Re: InternetConfig incompatibility between 10.2 and 10.1?
  • Index(es):
    • Date
    • Thread