<RX14>
plus writing stuff like that helps you to understand it a little better yourself
<FromGitter>
<bew> yeah, I didn't know about what this flag really does (returning EAGAIN), ty :)
<FromGitter>
<bew> @RX14 do you know macos a little bit?
<RX14>
not really
<RX14>
but it's 1:30am
<RX14>
and I trally should be sleeping
<FromGitter>
<bew> ahah go ahead, won't ask more questions!
<crystal-gh>
[crystal] bew opened pull request #5804: Use llvm5 for darwin build in CI (master...use-llvm5-circleci-for-darwin-build) https://git.io/vAjNN
<RX14>
nice pr
<FromGitter>
<bew> yes but it's not working ^^ remove that approval
<RX14>
approval means nothing if CI broke
<FromGitter>
<bew> hmm it's just weird to approve changes if it shoudl fix CI and CI break
<RX14>
it didn't fail when I approved it lol
<FromGitter>
<bew> ok, let's try again
<FromGitter>
<bew> it's fun because I did those commands an hour ago while trying to test #5413 on a macbook of a friend
<FromGitter>
<bew> looks like it worked this time!
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 245 seconds]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 245 seconds]
faustinoaq has joined #crystal-lang
snsei has joined #crystal-lang
_whitelogger has joined #crystal-lang
faustinoaq has quit [Quit: IRC client terminated!]
<FromGitter>
<watzon> Trying to get things working on my CentOS server is a pain in the ass
<FromGitter>
<watzon> I'm having trouble getting libgc working
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 245 seconds]
notdaniel has joined #crystal-lang
<crystal-gh>
[crystal] bew opened pull request #5806: Fix internal doc (typo & old invalid comment) (master...fix-internal-doc) https://git.io/vxefb
notdaniel has quit [Quit: Leaving]
DTZUZO has quit [Ping timeout: 245 seconds]
<crystal-gh>
[crystal] MakeNowJust opened pull request #5807: Semantic: fix behavior of union and proc notation with untyped expression (master...fix/crystal/ealry-return-for-untyped-union-and-proc-type) https://git.io/vxefh
<crystal-gh>
[crystal] bew opened pull request #5808: Semantic: Allow macro overload on named args (master...allow-macro-overload-on-named-args) https://git.io/vxeJC
alex`` has joined #crystal-lang
snsei has joined #crystal-lang
return0e has quit [Ping timeout: 268 seconds]
snsei has quit [Ping timeout: 276 seconds]
return0e has joined #crystal-lang
<FromGitter>
<bararchy> So again me and my C issues ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ I'm translating the commented C part, this part is wierd for me: `ioctl(dd, HCIGETCONNINFO, (unsigned long) cr) ` ... [https://gitter.im/crystal-lang/crystal?at=5aa51230f3f6d24c68605c5c]
<FromGitter>
<JonnyCodewalker> isnt the third argument of ioctl just a pointer to any memory that doesnt care about the type?
<FromGitter>
<JonnyCodewalker> i feel like the casted it to a simple type because ioctl cant work with a struct and made it an unsigned long as to not cut off data at the end? not sure though
<FromGitter>
<bararchy> In crystal it wont allow me to cast the struct into random stuff like that XD
<FromGitter>
<bararchy> so, should I just.. pass in a pointer?
<FromGitter>
<JonnyCodewalker> well in crystal not everything is just a bunch of bystes anyway :P. also as i said i am not sure, i am not that great with C.
<FromGitter>
<bararchy> hmmm @bew save me !
<FromGitter>
<bararchy> XD
<FromGitter>
<bararchy> or RX14
<RX14>
@bararchy just struct.unsafe_as(LibC::ULong)
<FromGitter>
<bararchy> Oh, damn nice trick !
<RX14>
but cr is a pointer
<RX14>
not a struct
<RX14>
they're just casting a pointer to a ulong
<FromGitter>
<JonnyCodewalker> oh damn, you are right.
<FromGitter>
<JonnyCodewalker> i should learn reading xD
<FromGitter>
<bararchy> isn't `cr` a struct hci_conn_info
<FromGitter>
<bararchy> oh, it's just the malloc
<FromGitter>
<bararchy> so it's just Pointer(Void) ?
<FromGitter>
<bararchy> with the size of the struct
<RX14>
yeah i think
<RX14>
i'd need to see more context
<RX14>
like your C code doesn't even have the type of cr in it
<FromGitter>
<bararchy> or sit in a bus, I one got 97 listed devices
<RX14>
lol
<RX14>
ok fixed
<RX14>
I need to literally be in the bluetooth menu on my phone
<FromGitter>
<bararchy> Yap, mine too
<RX14>
also "[Moto G (5) (820)]0\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u000
<RX14>
and it barely if at all uses any of the libhci stuff
<FromGitter>
<bararchy> Yeha, but its only the scan part
<RX14>
no its not
<RX14>
there's a next button
<FromGitter>
<bararchy> Oh...
<FromGitter>
<bararchy> Yeha
<RX14>
...
<FromGitter>
<bararchy> Hahaha
<FromGitter>
<bararchy> Yap my bad
<RX14>
I'm just starting to understand bluetooth's actual protocol structure
<RX14>
looks like all bluetooth protocols are built on top of L2CAP
<RX14>
I mean, what do you want to do with this library
<RX14>
presumably you'd want to have quite a lot of low-level control for use with fuzzing
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
<FromGitter>
<bararchy> My initial idea was binding the actual sockets , as in RFCOMM sockets and L2CAP socket.
<FromGitter>
<bararchy> But it seems I can send arbitrary commands to remote devices even using the HCI socket
<FromGitter>
<bararchy> Which seems to wrap around those low level parts
<FromGitter>
<bararchy> Also, I need to handle GATT
<FromGitter>
<bararchy> Which I guess will need a little bit different handling
<RX14>
@bararchy most things don't use rfcomm i think
<RX14>
l2cap seems to be the lowest layer you need to go to
<RX14>
I mean the lower you go the more you need to reimplement right?
<RX14>
reimplementing l2cap sounds like a lot of work
<FromGitter>
<bararchy> L2cap is the "udp" form of Bluetooth, while RFCOMM is the "TCP" part , you have relevance for both i think, I still research this
<RX14>
yeah that's the impression I got
<RX14>
except that rfcomm is built on top of l2cap
<RX14>
but tcp isnt built on top of udp
<RX14>
I think it's more kinda like l2cap is udp+ip
<FromGitter>
<bew> > but tcp inst built on top of udp
<FromGitter>
<bew> True in practice, but it's possible to do it
<FromGitter>
<bew> (I did at my first internship, was fun ˆˆ)
snsei has joined #crystal-lang
return0e has quit [Ping timeout: 240 seconds]
return0e has joined #crystal-lang
snsei has quit [Ping timeout: 252 seconds]
<FromGitter>
<watzon> Is there a way to get `String#gsub` to return `Regex::MatchData`, or is there another method that I can use? The block method for gsub seems to just loop over results and return matches one at a time.
<FromGitter>
<watzon> I want to basically be able to do `string.gsub { |m| " #{m[1] " }`
<FromGitter>
<straight-shoota> what exactly is not working for you?
<FromGitter>
<watzon> Ahh I tried that, but I was using `\\0` instead
<FromGitter>
<watzon> Making it `\\1` instead fixed my issue
<FromGitter>
<watzon> Thanks
<FromGitter>
<straight-shoota> or with evaluating MatchData manually: ⏎ `foo bar".gsub(/(fo+)/) { |string, matcher| "(#{matcher[1]})" }`
<FromGitter>
<straight-shoota> np
<FromGitter>
<straight-shoota> there are a lot of docs missing...
<FromGitter>
<watzon> Oh so `gsub` can return the match data
<FromGitter>
<watzon> Yeah that needs to be documented
<FromGitter>
<straight-shoota> oc
<FromGitter>
<watzon> The back references work great though
<FromGitter>
<bew> Oo why does `Dir.mkdir_p` always returns 0 ?
<FromGitter>
<straight-shoota> doesn't seem to make sense
<FromGitter>
<straight-shoota> I'm not sure it should return anything
<FromGitter>
<bew> hm I think the same here
<crystal-gh>
[crystal] bew opened pull request #5810: Ensure cleanup tempfile after some specs (master...ensure-cleanup-after-some-specs) https://git.io/vxePT
<FromGitter>
<watzon> PCRE doesn't support Unicode values like `\u0041`?
<FromGitter>
<watzon> At least the workaround isn't too much different
<FromGitter>
<genericpenguin> Hi all. I'm having a small issue with Fibers. I've got a basic TCP server that handles incoming connections as individual Fibers (where the connection is part of a player object), but I would like to have a channel that can receive messages from the outside after spawning. I keep a reference to the channel in the player object but when I send a message, it comes through only once, even though the spawn
<FromGitter>
<bew> @mikeyhew I think you meant `crystal init ...` not `crystal new ...`
<FromGitter>
<bew> and the command is `crystal init app lucky-docs-test`
Ven`` has joined #crystal-lang
livcd has quit [Remote host closed the connection]
<FromGitter>
<mikeyhew> @bew good point 😄
<FromGitter>
<mikeyhew> for the record, I *did* run `crystal init app lucky-docs-test`
<FromGitter>
<mikeyhew> after a few false starts
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alex`` has quit [Ping timeout: 245 seconds]
<FromGitter>
<genericpenguin> @straight-shoota thank you! I think I'm going to write a spawn_loop macro cause I keep on making the same mistake. Thanks again!