{"action":"created","issue":{"url":"https://api.github.com/repos/automatak/dnp3/issues/125","labels_url":"https://api.github.com/repos/automatak/dnp3/issues/125/labels{/name}","comments_url":"https://api.github.com/repos/automatak/dnp3/issues/125/comments","events_url":"https://api.github.com/repos/automatak/dnp3/issues/125/events","html_url":"https://github.com/automatak/dnp3/pull/125","id":79832042,"number":125,"title":"Link layer status listener interface","user":{"login":"neilstephens","id":9045862,"avatar_url":"https://avatars.githubusercontent.com/u/9045862?v=3","gravatar_id":"","url":"https://api.github.com/users/neilstephens","html_url":"https://github.com/neilstephens","followers_url":"https://api.github.com/users/neilstephens/followers","following_url":"https://api.github.com/users/neilstephens/following{/other_user}","gists_url":"https://api.github.com/users/neilstephens/gists{/gist_id}","starred_url":"https://api.github.com/users/neilstephens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neilstephens/subscriptions","organizations_url":"https://api.github.com/users/neilstephens/orgs","repos_url":"https://api.github.com/users/neilstephens/repos","events_url":"https://api.github.com/users/neilstephens/events{/privacy}","received_events_url":"https://api.github.com/users/neilstephens/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-05-23T12:22:57Z","updated_at":"2015-05-25T07:51:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/automatak/dnp3/pulls/125","html_url":"https://github.com/automatak/dnp3/pull/125","diff_url":"https://github.com/automatak/dnp3/pull/125.diff","patch_url":"https://github.com/automatak/dnp3/pull/125.patch"},"body":"Added a callback interface to LinkLayer, so the application can be notified when a stack's link layer transitions between RESET and UNRESET. Haven't tested it much, but it seems to work nicely.\r\n\r\nI took a shortcut, and just pass the callback using the link config object, because this is just a proof of concept. It'd be nicer to have an equivalent of the IChannel::AddStateListener(), like IStack::AddLinkStatusListener(), but whatever works.\r\n\r\nWe're using this in our data concentrator, so if an upstream master stops 'scanning' (confirming unsol messages) on what might be a multidrop channel, we get notified so we can stop 'scanning' downstream, freeing up the downstream outstation, so it can be scanned by a secondary datacon etc.\r\n\r\nWe also use it to set commlost quality on the points we're presenting upstream if the downstream link is lost. We previously used the channel state listener, but this is better.\r\n\r\nNot only does it allow multidrop channels with individual link statuses, but it also protects against locked up outstations/masters with an otherwise healthy channel. It would also go nicely with the link status keepalives you have planned :-)\r\n\r\nI hope you can get something like this into the stack, because it would be very useful.\r\n\r\nCheers,\r\nNeil. "},"comment":{"url":"https://api.github.com/repos/automatak/dnp3/issues/comments/105158248","html_url":"https://github.com/automatak/dnp3/pull/125#issuecomment-105158248","issue_url":"https://api.github.com/repos/automatak/dnp3/issues/125","id":105158248,"user":{"login":"neilstephens","id":9045862,"avatar_url":"https://avatars.githubusercontent.com/u/9045862?v=3","gravatar_id":"","url":"https://api.github.com/users/neilstephens","html_url":"https://github.com/neilstephens","followers_url":"https://api.github.com/users/neilstephens/followers","following_url":"https://api.github.com/users/neilstephens/following{/other_user}","gists_url":"https://api.github.com/users/neilstephens/gists{/gist_id}","starred_url":"https://api.github.com/users/neilstephens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neilstephens/subscriptions","organizations_url":"https://api.github.com/users/neilstephens/orgs","repos_url":"https://api.github.com/users/neilstephens/repos","events_url":"https://api.github.com/users/neilstephens/events{/privacy}","received_events_url":"https://api.github.com/users/neilstephens/received_events","type":"User","site_admin":false},"created_at":"2015-05-25T07:51:14Z","updated_at":"2015-05-25T07:51:14Z","body":"OK, great.\r\n\r\nI just finished cross-checking against the state diagram in the DNP3 spec, that I was calling the callback in the right spots. Turns out I missed a spot, so I added a commit.\r\n\r\nCheers,\r\nNeil. "}}